/* ==========================================
   Brand Section
   ========================================== */

.brand-section {
    position: relative;
    width: 100%;
    background-color: #000;
    padding: 0 0 110px 0;
}

.brand-section__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(40px, 8.33vw, 120px);
}

.brand-section__header {
    display: flex;
    align-items: center;
    padding: clamp(60px, 10vw, 150px) 0;
}

/* Brand Items */
.brand-section__items {
    font-family: 'IBM Plex Sans JP', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.brand-item {
    max-width: 1150px;
    width: 100%;
    height: clamp(150px, 16.7vw, 200px);
    margin: 0 auto 90px;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    background-color: #1E1E1E;
    position: relative;
}

.brand-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Even Layout: Image -> Content -> Logo */
.brand-item--even {
    justify-content: flex-start;
}

/* Odd Layout: Logo -> Content -> Image */
.brand-item--odd {
    justify-content: flex-end;
}

/* Image Wrap */
a.brand-item__image-wrap {
    text-decoration: none;
    color: inherit;
    display: block;
    -webkit-tap-highlight-color: transparent;
}

.brand-item__image-wrap {
    position: relative;
    width: clamp(200px, 26%, 300px);
    height: 100%;
    flex-shrink: 0;
}

.brand-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-item__name {
    position: absolute;
    bottom: 40%;
    color: #fff;
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 700;
    max-width: 200px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.brand-item--even .brand-item__name {
    text-align: left;
    left: clamp(-15px, -1.7vw, -20px);
}

.brand-item--odd .brand-item__name {
    text-align: right;
    left: auto;
    right: clamp(-15px, -1.7vw, -20px);
}

/* Arrow Button */
.brand-item__arrow {
    width: clamp(55px, 6.25vw, 75px);
    height: clamp(55px, 6.25vw, 75px);
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 10;
    transition: border-color 0.3s ease, color 0.3s ease;
    padding: 0;
}

.brand-item__arrow svg {
    width: clamp(28px, 3.3vw, 40px);
    height: auto;
    display: block;
}

.brand-item--even .brand-item__arrow,
.brand-item--odd .brand-item__arrow {
    margin-left: calc(-1 * clamp(27.5px, 3.125vw, 37.5px));
    margin-right: calc(-1 * clamp(27.5px, 3.125vw, 37.5px));
}

.brand-item__arrow:hover,
.brand-item__arrow:active {
    border-color: #ffd700;
    color: #ffd700;
}

/* Content */
.brand-item__content {
    flex: 1;
    color: #fff;
    min-width: 0;
    overflow: hidden;
}

.brand-item--even .brand-item__content {
    padding-right: clamp(30px, 4.5vw, 58px);
    padding-left: clamp(40px, 5.5vw, 66px);
}

.brand-item--odd .brand-item__content {
    padding-right: clamp(40px, 5.5vw, 66px);
    padding-left: clamp(30px, 4.5vw, 58px);
}

.brand-item__title {
    font-size: clamp(13px, 1.25vw, 15px);
    font-weight: 500;
    color: #fff;
    margin: 0 0 clamp(0.75rem, 0.83vw, 1rem);
    line-height: clamp(26px, 2.75vw, 33px);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.brand-item__desc {
    font-size: clamp(12px, 1.08vw, 13px);
    line-height: clamp(24px, 2.5vw, 30px);
    color: #fff;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.brand-item__desc p {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Divider */
.brand-item__divider {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: clamp(90px, 11.7vw, 140px);
    background-color: #fff;
}

.brand-item--even .brand-item__divider {
    right: calc(clamp(200px, 26%, 300px) - clamp(27.5px, 3.125vw, 37.5px));
}

.brand-item--odd .brand-item__divider {
    left: calc(clamp(200px, 26%, 300px) - clamp(27.5px, 3.125vw, 37.5px));
}

/* Logo */
.brand-item__logo-wrap {
    width: clamp(150px, 20.8vw, 250px);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-item__logo {
    max-width: clamp(70px, 7.5vw, 90px);
    height: auto;
    object-fit: contain;
}

/* ==========================================
   Responsive - Tablet (768px - 980px)
   ========================================== */

@media (max-width: 1025px) and (min-width: 768px) {
    .brand-section {
        padding-bottom: 60px;
    }

    .brand-item {
        cursor: pointer;
    }

    @keyframes arrowTapTablet {
        0%   { transform: scale(1); }
        40%  { transform: scale(0.82); }
        100% { transform: scale(1); }
    }

    .brand-item__arrow.tapping {
        animation: arrowTapTablet 0.32s ease-out forwards;
    }

    .brand-section__container {
        padding: 30px;
    }

    .brand-section__header {
        padding: clamp(50px, 8vw, 80px) 0 clamp(80px, 12vw, 125px);
    }

    .brand-item {
        height: clamp(140px, 18vw, 180px);
        margin-bottom: 60px;
    }

    .brand-item__image-wrap {
        width: clamp(180px, 24%, 220px);
    }

    .brand-item__name {
        max-width: 160px;
        font-size: 18px;
        font-weight: 600;
    }

    .brand-item--even .brand-item__content {
        padding-right: 43px;
        padding-left: clamp(40px, 7vw, 80px);
    }

    .brand-item--odd .brand-item__content {
        padding-right: clamp(40px, 7vw, 80px);
        padding-left: 43px;
    }

    .brand-item__title {
        -webkit-line-clamp: 2;
        line-height: clamp(22px, 2.5vw, 28px);
        word-break: break-all;
        text-wrap: wrap;
    }

    .brand-item__desc {
        -webkit-line-clamp: 2;
        line-height: clamp(20px, 2.3vw, 26px);
        word-break: break-all;
        text-wrap: wrap;
    }

    .brand-item__desc p {
        -webkit-line-clamp: 4;
        word-break: break-all;
        text-wrap: wrap;
    }

    .brand-item__arrow {
        width: clamp(50px, 5.5vw, 65px);
        height: clamp(50px, 5.5vw, 65px);
    }

    .brand-item__arrow svg {
        width: clamp(24px, 3vw, 35px);
    }

    .brand-item__divider {
        height: clamp(80px, 10vw, 120px);
    }

    .brand-item--even .brand-item__divider {
        right: calc(clamp(178px, 23.5%, 220px) - clamp(25px, 2.75vw, 32.5px));
    }

    .brand-item--odd .brand-item__divider {
        left: calc(clamp(178px, 23.5%, 220px) - clamp(25px, 2.75vw, 32.5px));
    }

    .brand-item__logo-wrap {
        width: clamp(130px, 18vw, 200px);
    }

    .brand-item__logo {
        max-width: clamp(60px, 6.5vw, 80px);
    }
}

/* Mobile (≤768px) - Code gọn */
@media (max-width: 768px) {
    .brand-section {
        padding: 0 0 75px 0;
    }

    .brand-section__container {
        padding: 0 1rem;
    }

    .brand-section__header {
        padding: 150px 0 100px 0;
    }

    .brand-section__items {
        align-items: center;
    }

    .brand-item {
        width: calc(100% - 60px);
        max-width: none;
        height: auto;
        flex-direction: column !important;
        margin: 0 0 75px;
        background: transparent;
        position: relative;
    }

    .brand-item__image-wrap {
        order: -1 !important;
        width: 100%;
        height: 220px;
        position: relative;
    }

    .brand-item__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .brand-item--odd .brand-item__name {
        position: absolute;
        top: 110px;
        right: -30px;
        left: auto;
        transform: translateY(-50%);
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        background: transparent;
        max-width: 250px;
        text-align: right;
        z-index: 2;
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
        line-height: 1.3;
    }

    .brand-item--even .brand-item__name {
        position: absolute;
        top: 110px;
        left: -30px;
        right: auto;
        transform: translateY(-50%);
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        background: transparent;
        max-width: 250px;
        text-align: left;
        z-index: 2;
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
        line-height: 1.3;
    }

    .brand-item--odd .brand-item__arrow {
        position: absolute;
        top: 110px;
        left: -30px;
        right: auto;
        transform: translateY(-50%);
        width: 60px;
        height: 60px;
        background: transparent;
        border: 2px solid #fff;
        margin: 0;
        z-index: 3;
    }

    .brand-item--even .brand-item__arrow {
        position: absolute;
        top: 110px;
        right: -30px;
        left: auto;
        transform: translateY(-50%);
        width: 60px;
        height: 60px;
        background: transparent;
        border: 2px solid #fff;
        margin: 0;
        z-index: 3;
    }

    .brand-item--odd .brand-item__arrow:active,
    .brand-item--even .brand-item__arrow:active,
    .brand-item:active .brand-item__arrow,
    .brand-item__arrow:hover,
    .brand-item__arrow:active {
        border-color: #fff;
        color: #fff;
    }

    a.brand-item__image-wrap:active,
    a.brand-item__image-wrap:hover {
        outline: none;
    }

    .brand-item__arrow svg {
        width: 25px;
    }

    .brand-item--odd .brand-item__logo-wrap {
        position: absolute;
        bottom: calc(100% - 220px);
        right: -1px;
        width: 55px;
        height: 55px;
        background: var(--logo-bg, #000);
        padding: 8px;
        z-index: 2;
        box-sizing: border-box;
    }

    .brand-item--even .brand-item__logo-wrap {
        position: absolute;
        bottom: calc(100% - 220px);
        left: -1px;
        width: 55px;
        height: 55px;
        background: var(--logo-bg, #000);
        padding: 8px;
        z-index: 2;
        box-sizing: border-box;
    }

    .brand-item__logo {
        max-width: 100%;
        object-fit: contain;
        max-height: 100%;
    }

    .brand-item__content {
        text-align: left !important;
        -webkit-text-align-last: left;
        width: 100%;
        padding: 30px 25px !important;
        background: #1E1E1E;
        margin-top: 0;
        box-sizing: border-box;
        overflow: visible;
    }

    .brand-item__title {
        font-size: 14px;
        line-height: 27px;
        font-weight: 600;
        margin-bottom: 1rem;
        -webkit-line-clamp: 2;
        min-height: 27px;
        letter-spacing: 0;
        word-break: break-all;
        text-wrap: wrap;
    }

    .brand-item__desc {
        font-size: 13px;
        line-height: 24px;
        font-weight: 400;
        color: #fff;
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
        letter-spacing: 0;
        word-break: break-all;
        text-wrap: wrap;
    }

    .brand-item__desc p {
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
        text-align-last: left;
        -webkit-text-align-last: left;
        word-break: break-all;
        text-wrap: wrap;
    }

    .brand-item__divider {
        display: none;
    }

    @keyframes arrowTap {
        0%   { transform: translateY(-50%) scale(1); }
        40%  { transform: translateY(-50%) scale(0.82); }
        100% { transform: translateY(-50%) scale(1); }
    }

    .brand-item__arrow.tapping {
        animation: arrowTap 0.32s ease-out forwards;
    }

}
