/* ===========================
ADDRESS PAGE
=========================== */

*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{
font-family:Poppins,sans-serif;
background:linear-gradient(
180deg,
#fafafa 0%,
#f3f4f8 100%
);
color:#222;
overflow-x:hidden;
}

.address-page{
max-width:1200px;
margin:40px auto;
padding:20px;
}

.page-header{
display:flex;
justify-content:space-between;
align-items:center;
flex-wrap:wrap;
gap:20px;
margin-bottom:30px;
}

.page-header h1{
font-size:36px;
font-weight:700;
}

.page-header p{
margin-top:8px;
color:#666;
}

#addAddressBtn{
border:none;
background:linear-gradient(135deg,#8B0F45,#C51D64);
color:#fff;
padding:14px 24px;
border-radius:12px;
font-size:15px;
font-weight:600;
cursor:pointer;
transition:.3s;
}

#addAddressBtn:hover{
transform:translateY(-2px);
box-shadow:0 10px 20px rgba(197,29,100,.25);
}

/* ===========================
ADDRESS GRID
=========================== */

#addressList{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(350px,1fr));
gap:25px;
}

/* ===========================
CARD
=========================== */
.address-card{

background:#fff;

border-radius:24px;

padding:24px;

border:1px solid #ececec;

box-shadow:
0 15px 40px rgba(0,0,0,.06);

transition:.35s;

position:relative;

overflow:hidden;

}

.address-card:hover{

transform:translateY(-6px);

border-color:#B09246;

box-shadow:
0 22px 45px rgba(176,146,70,.18);

}

.address-top{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:15px;
}

.address-type{
background:#f5e7ee;
color:#8B0F45;
padding:6px 14px;
border-radius:30px;
font-size:13px;
font-weight:600;
}

.default-badge{
background:#1BAE4B;
color:#fff;
padding:6px 12px;
border-radius:20px;
font-size:12px;
font-weight:600;
}

.address-card h3{
margin-bottom:10px;
font-size:20px;
}

.address-card p{
color:#666;
margin-bottom:6px;
line-height:1.6;
}

.address-actions{
display:flex;
gap:10px;
flex-wrap:wrap;
margin-top:20px;
}

.address-actions button{
flex:1;
min-width:100px;
border:none;
border-radius:10px;
padding:12px;
cursor:pointer;
font-weight:600;
transition:.3s;
}

.deliver-btn{

background:linear-gradient(
135deg,
#9D8331,
#B09246,
#D4B26A
);

color:#fff;

}

.deliver-btn:hover{

transform:translateY(-3px);

box-shadow:
0 12px 25px rgba(176,146,70,.35);

}

.edit-btn{

background:#f6f6f6;

color:#333;

}

.edit-btn:hover{

background:#ececec;

}

.delete-btn{

background:#fff2f2;

color:#c62828;

}

.delete-btn:hover{

background:#ffdddd;

}

.default-btn{
background:#fff6d6;
color:#b8860b;
}

.address-actions button:hover{
transform:translateY(-2px);
}

/* ===========================
EMPTY
=========================== */

.empty-address{
background:#fff;
padding:70px 20px;
text-align:center;
border-radius:20px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
grid-column:1/-1;
}

.empty-address h3{
margin:15px 0;
font-size:24px;
}

.empty-address p{
color:#777;
}

/* ===========================
MODAL
=========================== */

.address-modal{
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
background:rgba(0,0,0,.55);
display:none;
justify-content:center;
align-items:center;
padding:20px;
z-index:9999;
overflow-y:auto;
}

.address-modal.active{
display:flex;
}

.address-box{

background:#fff;

width:100%;

max-width:700px;

border-radius:28px;

padding:35px;

box-shadow:

0 30px 70px rgba(0,0,0,.18);

max-height:92vh;

overflow-y:auto;

}

@keyframes popup{

from{
transform:scale(.9);
opacity:0;
}

to{
transform:scale(1);
opacity:1;
}

}

#closeAddress{
position:absolute;
right:18px;
top:18px;
width:42px;
height:42px;
border:none;
border-radius:50%;
background:#eee;
font-size:24px;
cursor:pointer;
}

#modalTitle{
margin-bottom:25px;
}

#addressForm{
display:grid;
gap:16px;
}

#addressForm input,
#addressForm select{
width:100%;
height:54px;
padding:0 16px;
border:1px solid #ddd;
border-radius:12px;
font-size:15px;
outline:none;
}

#addressForm input:focus,
#addressForm select:focus{
border-color:#C51D64;
}

.two-grid{
display:grid;
grid-template-columns:1fr 1fr;
gap:15px;
}

.default-check{
display:flex;
align-items:center;
gap:10px;
font-size:15px;
}

.default-check input{
width:18px;
height:18px;
}

.save-btn{
height:55px;
border:none;
background:linear-gradient(135deg,#8B0F45,#C51D64);
color:#fff;
font-size:16px;
font-weight:700;
border-radius:12px;
cursor:pointer;
transition:.3s;
}

.save-btn:hover{
transform:translateY(-2px);
}

/* ===========================
DELETE MODAL
=========================== */

.delete-modal{
position:fixed;
left:0;
top:0;
width:100%;
height:100%;
background:rgba(0,0,0,.55);
display:none;
justify-content:center;
align-items:center;
z-index:10000;
}

.delete-modal.active{
display:flex;
}

.delete-box{
background:#fff;
padding:30px;
width:90%;
max-width:400px;
border-radius:20px;
text-align:center;
}

.delete-box h2{
margin-bottom:15px;
}

.delete-box p{
color:#666;
margin-bottom:25px;
}

.delete-actions{
display:flex;
gap:15px;
}

.delete-actions button{
flex:1;
height:50px;
border:none;
border-radius:10px;
cursor:pointer;
font-weight:600;
}

#cancelDelete{
background:#eee;
}

#confirmDelete{
background:#d50000;
color:#fff;
}

/* ===========================
SCROLLBAR
=========================== */

.address-box::-webkit-scrollbar{
width:8px;
}

.address-box::-webkit-scrollbar-thumb{
background:#C51D64;
border-radius:20px;
}

.selected-address{

border:2px solid #B09246;

background:#fffdf7;

box-shadow:
0 20px 40px rgba(176,146,70,.18);

}

/* ===========================
RESPONSIVE
=========================== */

@media(max-width:768px){

    .address-modal{

align-items:flex-start;

padding:10px;

}

.address-content{

max-height:95vh;

padding:20px;

border-radius:20px;

}

.address-page{
padding:15px;
margin:20px auto;
}

.page-header{
flex-direction:column;
align-items:flex-start;
}

.page-header h1{
font-size:28px;
}

#addressList{
grid-template-columns:1fr;
}

.address-actions{
flex-direction:column;
}

.address-actions button{
width:100%;
}

.two-grid{
grid-template-columns:1fr;
}

.address-box{
padding:22px;
max-height:95vh;
}

#addAddressBtn{
width:100%;
}

}