/* =====================================================
Addresses Page
===================================================== */

.ts-addresses-page{
    width:100%;
}

/* ==========================================
Header
========================================== */

.ts-page-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:30px;
}

.ts-page-title h2{
    margin:0;
    font-size:30px;
    font-weight:700;
    display:flex;
    align-items:center;
    gap:10px;
}

.ts-page-title p{
    margin:8px 0 0;
    color:#777;
    font-size:15px;
}


/* ==========================================
Grid
========================================== */

.ts-addresses-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(360px,1fr));
    gap:22px;
}


/* ==========================================
Address Card
========================================== */

.ts-warehouse-card{
    background:#fff;
    border:2px solid #ececec;
    border-radius:18px;
    padding:18px; /* تم تقليله قليلاً ليناسب الارتفاع الجديد */
    position:relative;

    display:flex;
    flex-direction:column;
    justify-content:space-between;

    min-height:170px;   /* تم تصغير طول الكارت إلى 170 بكسل */
    height: 170px;      /* لضمان ثبات الطول لجميع الكروت */

    transition:.25s;
}

.ts-warehouse-card:hover{
    border-color:#2155ff;
    transform:translateY(-3px);
}

.ts-warehouse-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px; /* تقليص الهامش لتوفير مساحة */
}

.ts-warehouse-name{
    font-size:18px;
    font-weight:700;
}

.ts-warehouse-options{
    display:flex;
    gap:8px;
}

.ts-warehouse-options button{
    width:36px;  /* تصغير الأزرار قليلاً لتناسب التصميم المدمج */
    height:36px;
    border:0;
    border-radius:10px;
    background:#f5f5f5;
    cursor:pointer;
    transition:.25s;
}

.ts-warehouse-options button:hover{
    background:#2155ff;
    color:#fff;
}


/* ==========================================
Location & Bottom Layout
========================================== */

.ts-warehouse-location{
    display:flex;
    gap:12px;
    align-items:flex-start;
    margin-bottom:0;
    color:#666;
    line-height:1.5;
    flex-grow: 1;
}

.ts-warehouse-location i{
    color:#2155ff;
    margin-top:3px;
}

.ts-warehouse-text{
    font-size:14px;
}


/* ==========================================
Footer & Buttons
========================================== */

/* جعل الـ footer بوضعية مطلقة محاذية للأسفل واليسار ليكون أمام الرمز البريدي */
.ts-warehouse-footer{
    position: absolute;
    bottom: 18px;
    left: 18px; 
    display:flex;
    justify-content:flex-end;
}

/* زر العنوان الافتراضي (الوضع العادي: أبيض) */
.ts-default-btn{
    border: 1px solid #2155ff;
    background: #fff;
    color: #2155ff;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: .25s ease;
}

/* عند وقوف المؤشر (الهوفر: يتحول إلى أزرق) */
.ts-default-btn:hover{
    background:#2155ff;
    border-color:#2155ff;
    color:#fff;
    transform:translateY(-2px);
    box-shadow:0 6px 15px rgba(33,85,255,.2);
}

/* تنسيق الكارت المفعل كافتراضي حالياً */
.ts-warehouse-card.default{
    border-color:#2155ff;
}

/* زر الكارت المعين كافتراضي بالفعل */
.ts-warehouse-card.default .ts-default-btn{
    background:#2155ff;
    color:#fff;
    border-color:#2155ff;
}

.ts-warehouse-card.default .ts-default-btn:hover{
    background:#1747dd;
    border-color:#1747dd;
    transform:translateY(-2px);
    box-shadow:0 8px 20px rgba(33,85,255,.3);
}

/* ==========================================
Add Card
========================================== */

.ts-warehouse-add-card{
    border:2px dashed #b8c7ff;
    border-radius:18px;
    min-height:170px; /* تم تعديله ليتطابق مع طول الكروت الأخرى */
    height:170px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    cursor:pointer;
    transition:.25s;
    color:#2155ff;
    background:#fafcff;
}

.ts-warehouse-add-card:hover{
    background:#eef4ff;
    border-color:#2155ff;
}

.ts-warehouse-add-card i{
    font-size:32px;
    margin-bottom:8px;
}

.ts-warehouse-add-card span{
    font-size:16px;
    font-weight:700;
}


/* ==========================================
Modals (Rename & Name Modal)
========================================== */

.ts-rename-modal{
    position:fixed;
    inset:0;
    display:none;
    justify-content:center;
    align-items:center;
    z-index:999999;
}

.ts-rename-modal.active{
    display:flex;
}

.ts-rename-overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.45);
}

.ts-rename-box{
    position:relative;
    width:420px;
    max-width:90%;
    background:#fff;
    border-radius:18px;
    padding:30px;
    z-index:2;
}

.ts-rename-box h3{
    margin-top:0;
    margin-bottom:20px;
}

.ts-rename-box input{
    width:100%;
    height:50px;
    border:1px solid #ddd;
    border-radius:12px;
    padding:0 16px;
    font-size:15px;
    outline:none;
}

.ts-rename-box input:focus{
    border-color:#2155ff;
}

.ts-rename-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:25px;
}

.ts-btn-primary{
    background:#2155ff;
    color:#fff;
    border:0;
    border-radius:12px;
    padding:12px 22px;
    cursor:pointer;
}

.ts-btn-light{
    background:#fff;
    border:1px solid #ddd;
    border-radius:12px;
    padding:12px 22px;
    cursor:pointer;
}

.ts-warehouse-name-modal{
    position: fixed;
    top: 80px;         
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    z-index: 999999;
}

.ts-warehouse-name-modal.active{
    display:flex;
}

.ts-warehouse-name-overlay{
    position: absolute;
    top: -80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.45);
}

.ts-warehouse-name-box{
    position:relative;
    width:420px;
    max-width:92%;
    background:#fff;
    border-radius:18px;
    padding:30px;
    z-index:2;
}

.ts-warehouse-name-box h3{
    margin:0 0 18px;
}

.ts-warehouse-name-box input{
    width:100%;
    height:52px;
    border:1px solid #ddd;
    border-radius:12px;
    padding:0 15px;
    font-size:15px;
}

.ts-warehouse-name-box input:focus{
    outline:none;
    border-color:#2155ff;
}

.ts-warehouse-name-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:25px;
}


/* ==========================================
Responsive
========================================== */

@media(max-width:768px){
    .ts-addresses-grid{
        grid-template-columns:1fr;
    }

    .ts-page-title h2{
        font-size:24px;
    }

    .ts-warehouse-name{
        font-size:18px;
    }
    
    /* ضبط موضع الزر في الجوال */
    .ts-warehouse-footer {
        position: static;
        margin-top: 10px;
    }
    .ts-warehouse-card {
        height: auto;
        min-height: 170px;
    }
}