/* =========================
   HEADER BASE
========================= */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    height: 88px;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}


.site-header.scrolled {
    background: #0f0f0f;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* LOGO */
.logo img {
    height: 56px;
}

/* DESKTOP NAV */
.main-nav ul {
    display: flex;
    gap: 32px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav .dropdown {
    display: block; /* override flex */
}

.main-nav .dropdown li {
    display: block;
}

.main-nav .dropdown {
    flex-direction: column; /* safety */
}

.main-nav a {
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    position: relative;
    opacity: 0.85;
}

.main-nav a::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: #fff;
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

/* DESKTOP ACTION */
.header-action {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* SEARCH */
.header-search {
    position: relative;
    max-width: 260px;
}

.search-wrapper,
.mobile-search {
    position: relative;
}

/* Search Icon */
.search-wrapper .search-icon,
.mobile-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.65);
    pointer-events: none;
    z-index: 1;
}

.header-search input {
    width: 200px;
    height: 40px;
    padding: 0 14px 0 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
    transition: border-color 0.25s, background 0.25s, width 0.3s ease;
}

.header-search input:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    width: 240px;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

/* Loading Spinner */
.search-spinner {
    display: none;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    pointer-events: none;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Search Result Dropdown */
.search-result {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    min-width: 280px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    z-index: 3000;
    max-height: 380px;
    overflow-y: auto;
    /* Animation */
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    scrollbar-width: thin;
}

.search-result.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Group Labels */
.search-group-label {
    padding: 10px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    border-top: 1px solid #f0f0f0;
}

.search-group-label:first-child {
    border-top: none;
}

/* Search Item */
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #111;
    transition: background 0.15s;
}

.search-item:hover,
.search-item.active {
    background: #f7f7f7;
}

.search-item.active {
    background: #f0f0f0;
}

/* Thumbnail */
.search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #efefef;
}

.search-thumb-placeholder {
    background: #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-thumb-placeholder::after {
    content: 'ðŸ–¼';
    font-size: 18px;
    opacity: 0.3;
}

/* Item text */
.search-item-text {
    flex: 1;
    min-width: 0;
}

.search-item-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-text span {
    font-size: 11.5px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 2px;
}

/* Match Highlight */
.search-item mark {
    background: none;
    color: #b5860d;
    font-weight: 700;
}

/* Type badge */
.search-item.type-series .search-item-text strong::after {
    content: ' Â· Series';
    font-size: 10px;
    font-weight: 500;
    color: #aaa;
}

/* Empty state */
.search-empty {
    padding: 18px 16px;
    font-size: 13px;
    color: #888;
    text-align: center;
}

.search-empty strong {
    color: #555;
}


/* LANGUAGE */
.lang-switch {
    font-size: 14px;
    color: #fff;
}

.lang-switch a {
    color: #fff;
    text-decoration: none;
}

.has-dropdown {
    position: relative;
}

/* box dropdown */
.dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 220px;
    background: #fff;
    padding: 12px 0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    z-index: 99;
    pointer-events: none;
}

/* Invisible bridge between menu and dropdown */
.dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

/* show dropdown - direct child only */
.has-dropdown:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0s;
    pointer-events: auto;
}

/* NESTED DROPDOWN (Carpet sub-menu) */
.dropdown .dropdown-nested {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 4px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
    pointer-events: none;
}

.dropdown .has-dropdown:hover > .dropdown-nested {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s;
    pointer-events: auto;
}

/* Indicator arrow for carpet item */
.dropdown .has-dropdown > a::after {
    content: ' â€º';
    font-size: 12px;
    opacity: 0.6;
    bottom: auto;
    width: auto;
    height: auto;
    background: none;
    position: static;
    display: inline;
}

/* item */
.dropdown li {
    width: 100%;
}

.dropdown a {
    display: block;
    padding: 10px 20px;

    font-size: 14px;
    color: #111;
    white-space: nowrap;
}

/* hover item */
.dropdown a:hover {
    background: rgba(0, 0, 0, 0.04);
}
/* =========================
   BURGER
========================= */
.burger {
    display: none;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    touch-action: manipulation;
}

.burger span {
    position: absolute;
    left: 9px;
    right: 9px;
    height: 2px;
    background: #fff;
    transition: transform 0.3s ease;
}

.burger span:first-child {
    top: 14px;
}
.burger span:last-child {
    bottom: 14px;
}

@media (max-width: 1024px) {
    .burger {
        display: block;
    }

    .main-nav,
    .header-action {
        display: none;
    }
}

/* =========================
   MOBILE MENU
========================= */
.mobile-menu {
    display: none;
    position: fixed;
    top: 88px;
    left: 0;
    width: 100%;
    height: calc(100vh - 88px);
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(10px);
    
    /* Animation State */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    z-index: 998;
    padding: 32px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.site-header.nav-open .mobile-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .mobile-menu {
        display: block;
    }
}


/* ===== MOBILE MENU NAV ===== */
.mobile-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0; 
    align-items: center; /* Center horizontally */
    text-align: center;  /* Center text */
}

.mobile-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%; /* Ensure full width for centering */
}

.mobile-nav li:last-child {
    border-bottom: none;
}

.mobile-nav a {
    font-family: var(--font-heading);
    font-size: 20px; /* Reduced from 24px */
    font-weight: 400;
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 20px 0;
    transition: color 0.3s ease, transform 0.3s ease;
    text-align: center; /* Explicitly center link text */
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: #d4a373;
    transform: translateY(-2px); /* Vertical instead of horizontal shift */
}

/* ===== MOBILE DROPDOWN ===== */

.mobile-dropdown {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    align-items: center; /* Center content */
}

.mobile-toggle {
    background: none;
    border: none;
    padding: 20px 0;
    margin: 0;

    width: 100%;
    text-align: center; /* Center text */

    font-family: var(--font-heading);
    font-size: 20px; /* Reduced from 24px */
    font-weight: 400;
    color: #fff;
    cursor: pointer;

    display: flex;
    justify-content: center; /* Center content */
    align-items: center;
    position: relative;
    transition: color 0.3s ease;
}

.mobile-toggle:hover {
    color: #d4a373;
}

.mobile-toggle .arrow {
    font-size: 14px;
    opacity: 0.7;
    position: absolute;
    right: 24px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%; /* Ensure full width for centering */
    
    background: rgba(255, 255, 255, 0.03); /* Subtle contrast */
    border-radius: 8px;

    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.mobile-submenu a {
    font-family: var(--font-body); /* Sans-serif for utility/sub */
    font-size: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
    text-align: center; /* Center text */
}

.mobile-submenu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    /* Remove padding-left shift on hover, keep padding consistent */
}

/* open */
.mobile-dropdown.open > .mobile-submenu {
    max-height: 600px;
    margin-bottom: 16px;
    margin-top: 8px;
    opacity: 1;
}

.mobile-dropdown.open > .mobile-toggle .arrow {
    transform: rotate(180deg); /* Full rotation looks cleaner */
    color: #d4a373;
}

.mobile-dropdown.open > .mobile-toggle {
    color: #d4a373;
}

/* MOBILE SEARCH */
.mobile-search {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-search .search-icon {
    top: calc(24px + 26px); /* border-top padding + half input height */
}

.mobile-search input {
    width: 100%;
    padding: 16px 44px; /* room for icon left + spinner right */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.mobile-search input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #d4a373;
    outline: none;
}

.mobile-search .search-spinner {
    top: calc(24px + 26px);
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

.mobile-search .search-result {
    position: relative;
    top: 8px;
    left: 0;
    right: 0;
    min-width: unset;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-height: 280px;
}


/* MOBILE LANGUAGE SWITCHER */
.mobile-lang {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mobile-lang a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-lang a.active,
.mobile-lang a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.mobile-lang span {
    color: rgba(255, 255, 255, 0.3);
}

/* NESTED MOBILE DROPDOWN (Carpet sub-categories) */
.mobile-dropdown-nested {
    border-bottom: none !important;
}

.mobile-dropdown-nested .mobile-toggle {
    font-family: var(--font-body);
    font-size: 16px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    justify-content: center;
}

.mobile-dropdown-nested .mobile-toggle:hover {
    color: #fff;
}

.mobile-submenu-nested {
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 4px;
}

.mobile-submenu-nested a {
    font-size: 14px !important;
    padding: 12px 32px !important;
    color: rgba(255, 255, 255, 0.65) !important;
}

.mobile-submenu-nested a:hover {
    color: #fff !important;
}

.mobile-dropdown-nested.open .mobile-toggle {
    color: #d4a373;
}

.mobile-dropdown.open > .mobile-toggle .arrow {
    transform: rotate(45deg);
}

/* =========================
   FOOTER
========================= */
.site-footer {
    background: #ededed;
    font-size: 14px;
    color: #111;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 80px;
    padding: 80px 0 40px;
}

.footer-brand {
    max-width: 420px;
}

.footer-logo {
    height: 72px;
    margin-bottom: 16px;
}

.footer-brand p {
    line-height: 1.7;
    color: #333;
}

.footer-nav {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-top: 150px;
}

.footer-nav a {
    color: #000000;
    text-decoration: none;
    font-size: 12px;
}

.footer-divider {
    border: none;
    border-top: 1px solid #000000;
}

/* MIDDLE */
.footer-middle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 64px;
    padding: 48px 0 64px;
}

.footer-col h4 {
    font-size: 15px;
    margin-bottom: 16px;
    color: #000000;
}

.footer-col p,
.footer-col a {
    font-size: 13.5px;
    line-height: 1.8;
    color: #333;
}

.footer-col a {
    text-decoration: none;
}

/* SOCIAL */
.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border: 1px solid #000000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-social img {
    width: 18px;
    height: 18px;
}

/* BOTTOM */
.footer-bottom {
    background: #000000;
    text-align: center;
    padding: 16px 0;
}

.footer-bottom p {
    color: #fff;
    font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .footer-top {
        flex-direction: column;
        gap: 32px;
    }

    .footer-nav {
        flex-wrap: wrap;
    }

    .footer-middle {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}
