/* Navigation CSS - ShirtUp-style two-panel mega menus */

/* ─── Top Bar ────────────────────────────────────────────── */
.header-top {
    background: var(--ub-navy, #00293D);
    color: white;
    padding: 8px 0;
    font-size: 13px;
}
.header-top a {
    color: #a8d8f0;
    text-decoration: none;
}
.header-top a:hover {
    text-decoration: underline;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Topbar breakpoint visibility — sm=480px md=768px lg=1024px */
.tb-bp          { display: none; width: 100%; }
.tb-mob         { display: flex; }
@media (min-width: 480px)  { .tb-mob { display: none; } .tb-sm  { display: flex; } }
@media (min-width: 768px)  { .tb-sm  { display: none; } .tb-md  { display: flex; } }
@media (min-width: 1024px) { .tb-md  { display: none; } .tb-lg  { display: flex; } }

/* ─── Header ─────────────────────────────────────────────── */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.header-main-wrapper {
    background: white;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 20px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    min-height: 82px;
    max-height: 82px;
}

/* ─── Logo ───────────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-img {
    height: 50px !important;
    width: auto;
    object-fit: contain;
}

/* ─── Search ─────────────────────────────────────────────── */
.search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-form {
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    background: white;
    color: #1f2937;
    font-size: 14px;
    transition: border-color 0.2s ease;
    outline: none;
}

.search-bar::placeholder {
    color: #9ca3af;
}

.search-bar:focus {
    border-color: var(--ub-navy, #00293D);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    margin-top: 8px;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #1e293b;
}

.search-suggestion-item:hover {
    background-color: #f8fafc;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

/* ─── Header Actions ─────────────────────────────────────── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s ease;
    text-decoration: none;
}

.icon-button:hover {
    border-color: var(--ub-navy, #00293D);
    background: #f9fafb;
}

.favorites-badge,
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    line-height: 20px;
    text-align: center;
}

.favorites-badge {
    background: var(--ub-cyan, #00B4D8);
}

.cart-count {
    background: #ef4444;
}

.mobile-toggle {
    display: none;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    color: #475569;
    font-size: 20px;
    cursor: pointer;
}

/* ─── Nav Bar ────────────────────────────────────────────── */
.nav-container {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    z-index: 999;
}

.nav-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    height: 48px;
    gap: 4px;
}

.nav-item {
    position: static;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-link {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--ub-navy, #00293D);
    border-bottom-color: var(--ub-navy, #00293D);
    text-decoration: none;
}

/* ─── Mega Menu ──────────────────────────────────────────── */
.mega-item {
    position: static;
    height: 100%;
}

.mega-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid #e5e7eb;
    /* Two-layer shadow: tight close shadow for the immediate detach,
       plus a softer wide shadow that blurs further down the page. */
    box-shadow:
        0 4px 8px rgba(0, 41, 61, 0.06),
        0 20px 48px rgba(0, 41, 61, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 998;
}

.mega-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-inner {
    /* Align with the 1280px page content width (hero, sections, etc.) */
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ─── Mega Columns (ShirtUp flat layout) ─────────────────── */
.mega-cols {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    gap: 24px 40px;
    align-items: start;
}

.mega-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mega-col-heading {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.3;
    transition: color 0.12s ease;
}

.mega-col-heading:hover {
    color: var(--ub-navy, #00293D);
    text-decoration: none;
}

.mega-link {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.12s ease;
    line-height: 1.4;
}

.mega-link:hover {
    color: #111827;
    text-decoration: none;
}

.mega-count {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    margin-left: 4px;
}
.mega-col-heading .mega-count {
    font-size: 12px;
    font-weight: 500;
}

/* ─── Mega Specials ──────────────────────────────────────── */
.mega-specials {
    flex-shrink: 0;
    width: 380px;
}

/* Grid container — height is intrinsic (driven by aspect-ratio of cards) */
.specials-grid {
    display: grid;
    gap: 8px;
}

/* ── Layout variants ── */

/* 1 big card */
.specials-grid.layout-single {
    grid-template-columns: 1fr;
}

/* 2 cards stacked vertically — fixed height, override aspect-ratio */
.specials-grid.layout-2v {
    grid-template-columns: 1fr;
    height: 300px;
    grid-template-rows: 1fr 1fr;
}
.specials-grid.layout-2v .special-photo {
    aspect-ratio: auto;
}

/* 2 cards side by side horizontally — fixed height, override aspect-ratio */
.specials-grid.layout-2h {
    grid-template-columns: 1fr 1fr;
    height: 300px;
}
.specials-grid.layout-2h .special-photo {
    aspect-ratio: auto;
}

/* 2 small cards left column + 1 tall card right column */
.specials-grid.layout-2l1r {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.specials-grid.layout-2l1r .special-card:nth-child(3) {
    grid-row: 1 / 3;
    grid-column: 2;
}

/* 1 wide card on top + 2 equal cards below */
.specials-grid.layout-1t2b {
    grid-template-columns: 1fr 1fr;
}
.specials-grid.layout-1t2b .special-card:first-child {
    grid-column: 1 / 3;
    aspect-ratio: 2 / 1;
}

/* 2x2 equal grid */
.specials-grid.layout-4grid {
    grid-template-columns: 1fr 1fr;
}

/* ── Base card ── */
.special-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.special-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    text-decoration: none;
}

/* ── Photo card ── */
.special-photo {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    color: white;
}

.special-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.08) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px 14px;
    gap: 2px;
}

.special-eyebrow {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    opacity: 0.85;
    color: white;
}

.special-photo .special-title {
    font-size: 13px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.special-arrow {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #111;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.special-card:hover .special-arrow {
    opacity: 1;
}

/* ── Promo card ── */
.special-promo {
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 120px;
}

.special-promo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.25;
}

.special-promo-content {
    position: relative;
    z-index: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    justify-content: center;
}

.special-promo-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.3px;
    line-height: 1.1;
    color: white;
    text-transform: uppercase;
}

/* Smaller title for taller single cards */
.layout-single .special-promo-title,
.layout-2l1r .special-card:nth-child(3) .special-promo-title {
    font-size: 22px;
}

.special-promo-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}

.special-promo-items {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.special-promo-items li {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-align: center;
}

/* ─── Featured Area (kept for backwards compat) ──────────── */
.mega-featured-area {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
}

.mega-featured-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 160px;
    aspect-ratio: 3 / 4;
    background: linear-gradient(160deg, var(--ub-navy, #00293D) 0%, var(--ub-navy, #00293D) 100%);
    border-radius: 10px;
    padding: 16px;
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, background 0.2s ease;
    overflow: hidden;
}

.mega-featured-card:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
    background: linear-gradient(160deg, var(--ub-navy, #00293D) 0%, #1e2a3d 100%);
}

.mega-featured-eyebrow {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.65;
    margin-bottom: 4px;
}

.mega-featured-name {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

/* ─── Mobile Toggle ──────────────────────────────────────── */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-menu-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 20px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #1e293b;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-search {
    margin-bottom: 20px;
}

.mobile-search-container {
    display: flex;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.mobile-search-input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 16px;
    outline: none;
}

.mobile-search-btn {
    background: var(--ub-navy, #00293D);
    border: none;
    color: white;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.mobile-quick-actions {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-section {
    margin: 20px 0 8px 0;
}

.mobile-nav-section h4 {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
}

.mobile-brand-letter h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ub-navy, #00293D);
    margin: 8px 0 4px;
}

.mobile-nav-item {
    margin-bottom: 2px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover {
    background: #f8fafc;
    color: var(--ub-navy, #00293D);
    text-decoration: none;
}

.mobile-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #1e293b;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.15s ease;
}

.mobile-action-btn:hover {
    background: #f8fafc;
    text-decoration: none;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .search-container {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu {
        width: 100%;
    }

    /* Tighten header layout so logo + action icons fit on narrow viewports */
    .header-container {
        gap: 12px;
        padding: 12px 12px !important;
    }
    .logo-img {
        max-width: 140px;
        height: auto;
    }
    .header-actions {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .header-container {
        gap: 8px;
        padding: 10px 10px !important;
    }
    .logo-img {
        max-width: 120px;
    }
    .header-actions {
        gap: 8px;
    }
    /* Icon buttons stay ≥40px for touch accessibility */
    .icon-button {
        width: 40px;
        height: 40px;
    }
    .mobile-toggle {
        padding: 8px 10px;
        font-size: 18px;
    }
}

/* ─── Smooth scrolling ───────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ─── Focus styles ───────────────────────────────────────── */
.nav-link:focus,
.search-bar:focus {
    outline: 2px solid var(--ub-navy, #00293D);
    outline-offset: 2px;
}
