/* ============================================
   CUSTOM OVERRIDES — Yuyang Aluminum Clone
   Fixes display issues when running locally
   ============================================ */

/* ── Shared fixed header behavior across all pages ──────────────────────── */
.header {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 10050 !important;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.header-bottom-nav {
    background: #fff;
}

/* Reserve space so the fixed header never covers page content */
body {
    padding-top: 136px;
}

/* Anchor links should land below the sticky header */
[id] {
    scroll-margin-top: 150px;
}

/* ── Prevent any element from causing horizontal page overflow ─────────── */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ── Top nav bar: always sits above the circular logo ───────────────────── */
.header-top-nav {
    position: relative;
    z-index: 200;
    overflow: hidden; /* clip anything that would poke out sideways */
}

/* Tighter spacing between top-bar items so all 3 numbers fit before the logo */
.header-top-nav .header-left ul.d-flex {
    gap: 0;
    flex-wrap: nowrap;
    align-items: center;
}

.header-top-nav .header-left ul.d-flex li {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    white-space: nowrap;
    font-size: 13px;
}

/* Divider between items */
.header-top-nav .header-left ul.d-flex li + li {
    border-left: 1px solid rgba(255,255,255,0.15);
}

/* Icons stay in line */
.header-top-nav .header-left .iconfont {
    font-size: 14px;
    flex-shrink: 0;
}

/* Anchor links in top bar match the smaller size */
.header-top-nav .header-left a {
    font-size: 13px;
}

/* ── Hamburger button: always on top, always clickable ───────────────────── */
.btn-menu {
    position: relative;
    z-index: 9999 !important;
}

.btn-menu a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    cursor: pointer;
    position: relative;
    z-index: 9999 !important;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-menu a::before,
.btn-menu a::after,
.btn-menu span {
    display: block !important;
    width: 26px !important;
    background: #111 !important;
    height: 3px !important;
    border-radius: 999px;
    margin: 0 !important;
    opacity: 1 !important;
    position: absolute !important;
    left: 50%;
    transform: translateX(-50%);
}

.btn-menu a::before {
    content: "" !important;
    top: 13px !important;
}

.btn-menu span {
    top: 21px !important;
}

.btn-menu a::after {
    content: "" !important;
    top: 29px !important;
}

/* Search circle must sit BELOW the hamburger */
.index-search-box {
    z-index: 100 !important;
}

/* ── Mobile menu drawer ─────────────────────────────────────────────────── */
#mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0,0,0,0.5);
}

#mobile-nav-overlay.open {
    display: block;
}

#mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background: #1a1a1a;
    z-index: 99999;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 0 0 80px;
}

#mobile-nav-drawer.open {
    right: 0;
}

#mobile-nav-close {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    color: #fff;
    font-size: 26px;
    line-height: 1;
}

#mobile-nav-drawer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#mobile-nav-drawer > ul > li {
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

#mobile-nav-drawer > ul > li > a {
    display: block;
    padding: 16px 24px;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    text-transform: uppercase;
}

#mobile-nav-drawer > ul > li > a:hover {
    color: #f0c040 !important;
}

/* Sub-items (product series list) */
#mobile-nav-drawer .mob-sub {
    display: block;
    background: rgba(255,255,255,0.04);
}

#mobile-nav-drawer .mob-sub li a {
    display: block;
    padding: 11px 24px 11px 36px;
    color: rgba(255,255,255,0.7) !important;
    font-size: 14px;
    text-decoration: none !important;
    border-top: 1px solid rgba(255,255,255,0.05);
}

#mobile-nav-drawer .mob-sub li a:hover {
    color: #f0c040 !important;
}

/* Product parent toggle arrow */
.mob-parent-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#mobile-nav-drawer .mob-parent-toggle > a {
    display: block;
    flex: 1 1 auto;
    padding: 16px 24px;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    text-transform: uppercase;
}

#mobile-nav-drawer .mob-parent-toggle > a:hover {
    color: #f0c040 !important;
}

.mob-arrow {
    padding-right: 24px;
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    transition: transform 0.2s;
    cursor: pointer;
    user-select: none;
}

.mob-arrow.open {
    transform: rotate(180deg);
}

/* ── Mobile: collapse the top bar sensibly (≤ 768 px) ───────────────────── */
@media (max-width: 768px) {
    /* Hide the top bar — xs-online bottom bar already has email/tel/whatsapp */
    .header-top-nav {
        display: none !important;
    }

    body {
        padding-top: 76px;
    }

    .header {
        box-shadow: 0 3px 14px rgba(0, 0, 0, 0.08);
    }

    .header-bottom-nav {
        height: 76px !important;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .header-search,
    .index-search-box,
    .header-bottom-nav .index-button-search {
        display: none !important;
    }

    .btn-menu {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        margin-left: 12px;
    }

    .btn-menu a {
        width: 46px;
        height: 46px;
    }

    .btn-menu a::before,
    .btn-menu a::after,
    .btn-menu span {
        width: 24px !important;
    }

    .btn-menu a::before {
        top: 14px !important;
    }

    .btn-menu span {
        top: 21px !important;
    }

    .btn-menu a::after {
        top: 28px !important;
    }

    .header-logo {
        z-index: 3;
        height: 56px !important;
        left: 12px !important;
    }

    .header-logo::after {
        width: 80px !important;
        height: 72px !important;
    }

    /* Banner fills full width */
    .home_banner,
    .home_banner .swiper-container,
    .home_banner .swiper-wrapper,
    .home_banner .swiper-slide,
    .home_banner .slide-inner,
    .home_banner .slide-link,
    .home_banner img {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    .container, .wrap, main, section, footer {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Hide the desktop PC nav on mobile */
    .header-pc-nav {
        display: none !important;
    }

    [id] {
        scroll-margin-top: 95px;
    }

    #mobile-nav-drawer {
        width: min(92vw, 340px);
    }
}

/* 1. WOW.js sets visibility:hidden on all .wow elements.
      Override so content is always visible regardless of JS timing. */
.wow {
    visibility: visible !important;
    animation-fill-mode: both;
}

/* 2. Banner — ensure height even before Swiper initialises.
      Swiper CSS sets height:100% on wrapper/slides which collapses to 0 without JS.
      Override with min-height so the image is visible immediately. */
.home_banner .swiper-container {
    min-height: 400px;
    width: 100%;
    overflow: hidden;
}

.home_banner .swiper-wrapper {
    /* Allow wrapper to size to its content height without JS */
    height: auto !important;
    min-height: 400px;
    /* Keep horizontal direction (flex-direction:column is a Swiper vertical override) */
    flex-direction: row;
}

.home_banner .swiper-slide {
    min-height: 400px;
    height: auto !important;
    flex-shrink: 0;
    width: 100% !important;
}

.home_banner .swiper-slide .slide-inner {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
}

.home_banner .swiper-slide img {
    width: 100%;
    min-height: 400px;
    height: auto;
    max-height: 90vh;
    object-fit: cover;
    display: block;
}

/* 3. Product slider — make items scroll horizontally without Slick */
.index-section1 .index-product-slick .item-list:not(.slick-initialized) {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    margin: 0;
    gap: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #0328A5 #eee;
    padding-bottom: 10px;
}

.index-section1 .index-product-slick .item-list:not(.slick-initialized) .item {
    min-width: 260px;
    max-width: 300px;
    flex-shrink: 0;
}

/* 4. Product item image boxes */
.index-section1 .index-product-slick .item-box .img-box {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
}

.index-section1 .index-product-slick .item-box .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 5. Category cards (section 2) — img.img-box uses padding-bottom trick,
      so the image inside must be position: absolute */
.index-section2 .box2-product li .img.img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The hover overlay product-img also uses padding-bottom: 100% */
.index-section2 .box2-product .index-product-box .product-img .img-box {
    position: relative;
    overflow: hidden;
}

.index-section2 .box2-product .index-product-box .product-img .img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 6. Ensure the section 4 choose-img renders */
.index-section4 .choose-img .img-box {
    position: relative;
    padding-bottom: 120%;
    overflow: hidden;
}

.index-section4 .choose-img .img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 7. Section 3 minimum height so it shows even if background fails */
.index-section3 {
    min-height: 400px;
    padding: 80px 0;
}

/* 8. Section 4 minimum height */
.index-section4 {
    min-height: 400px;
    padding: 80px 0;
}

/* 9. Fix iconfont icons — ensure they render as text */
.iconfont {
    font-style: normal;
    line-height: 1;
}

/* 10. Sidebar visible on desktop */
.ct_aside1 {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
}

/* 11. Photo Gallery Section */
.index-gallery-section {
    padding: 80px 0 90px;
    background: #fff;
}

.index-gallery-section .index-title h2 {
    font-size: 38px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    gap: 12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    background: #f0f0f0;
}

.gallery-item--tall {
    grid-row: span 2;
}

.gallery-item--wide {
    grid-column: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 18px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: Onest, sans-serif;
}

@media (max-width: 1199px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 250px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
        gap: 8px;
    }
    .gallery-item--tall { grid-row: span 1; }
    .gallery-item--wide { grid-column: span 1; }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 160px;
    }
}

/* 13. Scrollbar arrow visibility without Slick */
.index-quality-arrow {
    display: flex;
    justify-content: flex-end;
    padding-right: 2vw;
    gap: 10px;
    margin-bottom: 10px;
}

.index-quality-arrow .arrow {
    width: 44px;
    height: 44px;
    border: 1px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.index-quality-arrow .arrow.prev .iconfont {
    transform: rotate(180deg);
    display: inline-block;
}

/* ── Banner slide caption overlays ──────────────────────────────────────── */
.home_banner .slide-inner {
    position: relative;
    overflow: hidden;
}

/* Dark gradient from left for default captions */
.home_banner .slide-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Right-aligned slides get gradient from right */
.home_banner .slide-inner:has(.slide-caption--right)::after {
    background: linear-gradient(270deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.25) 55%, transparent 100%);
}

.slide-caption {
    position: absolute;
    top: 50%;
    left: 7%;
    transform: translateY(-50%);
    z-index: 2;
    color: #fff;
    max-width: 520px;
    pointer-events: none;
}

.slide-caption--right {
    left: auto;
    right: 7%;
    text-align: right;
}

.slide-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 2.5px;
    font-weight: 700;
    color: #f0c040;
    text-transform: uppercase;
    margin-bottom: 14px;
    border-left: 3px solid #f0c040;
    padding-left: 10px;
}

.slide-caption--right .slide-tag {
    border-left: none;
    border-right: 3px solid #f0c040;
    padding-left: 0;
    padding-right: 10px;
}

.slide-caption h2 {
    font-size: clamp(28px, 3.5vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.slide-caption p {
    font-size: clamp(13px, 1.4vw, 16px);
    line-height: 1.7;
    color: rgba(255,255,255,0.88);
    margin-bottom: 28px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.slide-btn {
    display: inline-block;
    padding: 13px 30px;
    background: #b8860b;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    pointer-events: all;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.slide-btn:hover {
    background: #9a720a;
    transform: translateY(-2px);
    color: #fff !important;
    text-decoration: none;
}

/* Ensure slide link image sits behind caption */
.home_banner .slide-link {
    display: block;
    position: relative;
    z-index: 0;
}

@media (max-width: 768px) {
    .slide-caption,
    .slide-caption--right {
        left: 5%;
        right: 5%;
        text-align: left;
        max-width: 90%;
    }
    .slide-caption--right .slide-tag {
        border-left: 3px solid #f0c040;
        border-right: none;
        padding-left: 10px;
        padding-right: 0;
    }
    .home_banner .slide-inner::after {
        background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.65) 100%);
    }
    .slide-caption {
        top: auto;
        bottom: 60px;
        transform: none;
    }
}
