/* =========================================
   CONTAINER CHÍNH
   ========================================= */
.mas-accordion-wrapper.mas-layout-classic {
    display: flex;
    width: 100%;
    height: 90vh; 
    min-height: 600px;
    overflow: hidden;
    position: relative;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #1a252b; 
    
    /* Biến CSS từ PHP truyền vào */
    --mas-title-size: 26px;
    --mas-label-size: 32px;
    --mas-desc-size: 16px;
    --mas-title-weight: 700;
    --mas-label-weight: 600;
    --mas-desc-weight: 400;
}

/* =========================================
   ITEM SLIDE
   ========================================= */
.mas-layout-classic .mas-acc-item {
    position: relative;
    height: 100%;
    min-width: 180px; 
    width: 180px;     
    border-right: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    flex-shrink: 0;
    
    /* Cấu hình ảnh nền */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-clip: padding-box;
    transform: translateZ(0);
}

/* Trạng thái Active (Mở rộng) */
.mas-layout-classic .mas-acc-item.active {
    flex-grow: 1;    
    cursor: default; 
}

/* =========================================
   LỚP PHỦ (OVERLAY) & SỐ NỀN
   ========================================= */
.mas-layout-classic .mas-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.2); 
    transition: background 0.4s;
    pointer-events: none;
    z-index: 1;
}

.mas-layout-classic .mas-acc-item.active .mas-overlay {
    background: transparent; 
}

.mas-layout-classic .mas-acc-item:not(.active):hover .mas-overlay {
    background: rgba(0,0,0,0.4);
}

/* Số nền to phía sau (Desktop) */
.mas-layout-classic .mas-bg-number {
    position: absolute;
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    font-size: 120px; 
    font-weight: 300;
    line-height: 1;
    font-family: sans-serif;
    letter-spacing: -5px;
    writing-mode: vertical-rl;
    white-space: nowrap;
    z-index: 2;
    opacity: 0.2; 
    transition: all 0.6s ease;
    pointer-events: none;
}

.mas-layout-classic .mas-acc-item.active .mas-bg-number {
    opacity: 0.6;
    top: 40px; 
    left: 40px;
    bottom: auto;
    transform: none; 
    writing-mode: horizontal-tb;
    font-size: 60px; 
    font-weight: 700;
    letter-spacing: -2px;
}

/* =========================================
   DẢI THU NHỎ (STRIP)
   ========================================= */
.mas-layout-classic .mas-acc-strip {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 3;
    pointer-events: none; 
    transition: opacity 0.3s;
}

.mas-layout-classic .mas-acc-item.active .mas-acc-strip {
    opacity: 0;
}

.mas-layout-classic .mas-strip-inner {
    display: flex; flex-direction: column;
    justify-content: space-between; height: 100%;
    padding: 0; box-sizing: border-box;
}

.mas-layout-classic .mas-strip-top {
    padding: 30px; display: flex; justify-content: flex-end;
}
.mas-layout-classic .mas-arrow { 
    opacity: 0.8; display: block; 
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); 
}

.mas-layout-classic .mas-strip-bottom {
    display: flex; flex-direction: column; align-items: center;
    width: 100%; 
    padding-bottom: 150px; 
    flex-grow: 1; 
    justify-content: flex-end; 
    overflow: hidden;
}

.mas-layout-classic .mas-label {
    writing-mode: vertical-rl; transform: rotate(180deg);
    text-transform: uppercase;
    font-size: var(--mas-label-size) !important; 
    letter-spacing: 3px; font-weight: var(--mas-label-weight) !important;
    white-space: nowrap; opacity: 0.95;
    max-height: 80%; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* =========================================
   NỘI DUNG CHÍNH (CONTENT)
   ========================================= */
.mas-layout-classic .mas-acc-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden;
    transition: opacity 0.5s 0.3s;
    z-index: 3;
    display: flex;
}

.mas-layout-classic .mas-acc-item.active .mas-acc-content {
    opacity: 1; visibility: visible;
}

.mas-layout-classic .mas-content-inner {
    display: flex; width: 100%; height: 100%; padding: 0;
}

.mas-layout-classic .mas-img-wrap {
    width: 100%; height: 100%;
    display: flex;
    align-items: flex-end; 
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 40px;
}

.mas-layout-classic .mas-text-wrap {
    width: 100%;
    box-sizing: border-box;
    padding: 20px; 
    background: rgba(0, 0, 0, 0.65);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: flex-start; 
    text-align: left;
    max-width: 700px; 
}

.mas-layout-classic .mas-title {
    font-size: var(--mas-title-size) !important; 
    margin: 0 0 20px 0;
    line-height: 1.2;
    font-weight: var(--mas-title-weight) !important;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6); 
}

.mas-layout-classic .mas-desc {
    font-size: var(--mas-desc-size) !important;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.95;
    font-weight: var(--mas-desc-weight) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.mas-layout-classic .mas-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px; 
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
    transition: all 0.3s;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(4px); 
}
.mas-layout-classic .mas-btn:hover {
    background: #fff;
    color: #000 !important;
    border-color: #fff;
}
.mas-layout-classic .icon-arrow { margin-left: 8px; }

/* =========================================
   MOBILE RESPONSIVE (ĐÃ NÂNG CẤP)
   ========================================= */
@media (max-width: 991px) {
    .mas-accordion-wrapper.mas-layout-classic { 
        flex-direction: column; 
        height: auto; 
    }
    
    /* --- CẬP NHẬT 1: Sửa lại chiều cao để có thể animate mượt mà --- */
    .mas-layout-classic .mas-acc-item { 
        width: 100%; 
        min-width: 100%; 
        min-height: 80px; 
        height: 80px;     
        border-right: none; 
        border-bottom: 1px solid rgba(255,255,255,0.1); 
    }
    
    .mas-layout-classic .mas-acc-item.active { 
        height: auto;
        min-height: auto;
        padding-bottom: 62.5vw; /* Tỷ lệ hoàn hảo 16:10 cho 1440x900 để không bị thừa khoảng trắng */
        display: block; 
        background-position: center bottom;
    }
    
    /* Cố định iframe ở dưới cùng với tỷ lệ chính xác */
    .mas-layout-classic .mas-acc-item.active .mas-html-bg {
        top: auto !important;
        bottom: 0 !important;
        height: 62.5vw !important;
    }
    
    /* Số nền Mobile */
    .mas-layout-classic .mas-bg-number {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: 50px;
        top: 20px; left: 20px;
        bottom: auto; right: auto;
        opacity: 0.5;
    }
    
    .mas-layout-classic .mas-acc-item.active .mas-bg-number {
        opacity: 0.4; 
        top: 20px; left: 20px; bottom: auto;
        writing-mode: horizontal-tb;
        font-size: 50px;
        transform: none;
    }

    /* Strip Mobile */
    .mas-layout-classic .mas-strip-inner { 
        flex-direction: row; 
        justify-content: space-between; 
        padding: 0 25px; 
        align-items: center; 
        /* Đảm bảo nội dung luôn được căn giữa theo chiều dọc nếu ô cao lên */
        min-height: 80px; 
    }
    .mas-layout-classic .mas-strip-top { padding: 0; order: 2; }
    
    .mas-layout-classic .mas-strip-bottom { 
        width: auto; 
        padding-bottom: 0; 
        order: 1; 
        flex-grow: 1; /* Cho phép vùng chứa chữ mở rộng */
        justify-content: center;
        align-items: flex-start; /* Căn chữ sang trái */
    }
    
    /* --- CẬP NHẬT 2: Cho phép chữ Label xuống dòng --- */
    .mas-layout-classic .mas-label { 
        writing-mode: horizontal-tb; transform: none; 
        
        /* Căn chỉnh lại vị trí để né số nền to (01, 02) */
        margin-left: 55px; 
        
        max-height: none;
        
        /* Quan trọng: Cho phép xuống dòng */
        white-space: normal; 
        text-align: left;
        line-height: 1.4;
        width: 100%; /* Chiếm hết chiều rộng cho phép */
        padding: 15px 0; /* Thêm padding trên dưới để thoáng */
        font-size: var(--mas-label-size-mobile) !important;
    }
    
    .mas-layout-classic .mas-arrow svg { 
        width: 30px; height: 30px; transform: rotate(90deg); 
    }

    /* Nội dung Active Mobile: Box chữ ở trên, Ảnh ở dưới */
    .mas-layout-classic .mas-acc-item.active .mas-acc-content,
    .mas-layout-classic .mas-acc-item.active .mas-content-inner,
    .mas-layout-classic .mas-acc-item.active .mas-img-wrap {
        position: relative;
        height: auto;
        display: block; /* Chiếm chiều cao tự nhiên của nội dung */
    }
    
    .mas-layout-classic .mas-img-wrap {
        padding: 0;
    }
    
    .mas-layout-classic .mas-text-wrap { 
        padding: 30px 25px; 
        background: #ffffff !important; 
        border-radius: 0;
        backdrop-filter: none;
        justify-content: flex-start; 
        align-items: flex-start; 
        text-align: left;
        max-width: none; 
        width: 100%;
        flex: none;
    }
    
    /* Ghi đè màu chữ thành đen trên nền trắng */
    .mas-layout-classic .mas-title,
    .mas-layout-classic .mas-desc {
        color: #000000 !important;
        text-shadow: none !important;
    }
    .mas-layout-classic .mas-btn {
        color: #000000 !important;
        border-color: #000000 !important;
        background: transparent !important;
    }
    
    .mas-layout-classic .mas-title { margin-bottom: 15px; }
}