/* Custom styles for Virtuosa */

:root {
    --navy: #0A1128;
    --dark-navy: #060A18;
    --gold: #FFD700;
    --button-gold: #C19A6B;
    --button-gold-hover: #A98B68;
}

body {
    font-family: 'Inter', sans-serif;
}

.bg-navy {
    background-color: var(--navy);
}

.bg-dark-navy {
    background-color: var(--dark-navy);
}

.text-gold {
    color: var(--gold);
}

.bg-gold {
    background-color: var(--gold);
}

.bg-button-gold {
    background-color: var(--button-gold);
}

.hover-bg-button-gold:hover {
    background-color: var(--button-gold-hover);
}

/* Hide an element and remove it from the layout */
.hidden {
    display: none !important;
}

/* Seller Dashboard Links */
.seller-dashboard-link {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.seller-dashboard-link:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.mobile-menu-link.bg-green-600 {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    font-weight: 500 !important;
}

.mobile-menu-link.bg-green-600:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
    background: white;
    color: #0A1128;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 6px solid #C19A6B;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #10B981;
}

.toast.error {
    border-left-color: #EF4444;
}

.toast.info {
    border-left-color: #3B82F6;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 600;
}

.toast-icon {
    font-size: 1.25rem;
}

/* ============================== */
/* Virtuosa Responsive Utilities  */
/* ============================== */

/* Containers */
.v-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 12px;
    padding-right: 12px;
}

@media (min-width: 768px) {
    .v-container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* Header: Default hidden, shown at tablet+ */
.desktop-header-container {
    display: none;
}

/* Header: Consistent two-row layout for tablet+ */
@media (min-width: 768px) {
    .desktop-header-container {
        display: block !important;
    }

    .v-header-row-upper {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        padding: 0.5rem 0 !important;
        min-height: 60px !important;
        width: 100% !important;
    }
    
    .v-header-logo {
        flex: 0 0 auto !important;
        min-width: 100px !important;
        margin-right: 1rem;
    }
    
    .v-header-search {
        flex: 1 1 0% !important;
        min-width: 200px !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    .v-header-actions {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 1.5rem !important;
        justify-content: flex-end !important;
        margin-left: 1rem;
    }

    .v-header-search .relative {
        display: flex;
        width: 100%;
        max-width: 800px;
    }

    #home-search-input {
        border-radius: 9999px 0 0 9999px;
        height: 44px;
        border: 1px solid #374151;
        background-color: #1f2937;
        color: white;
        padding-left: 1.25rem;
        flex: 1;
        min-width: 0;
    }

    #home-search-button {
        position: static !important;
        transform: none !important;
        background-color: #C19A6B;
        color: white;
        padding: 0 24px;
        border-radius: 0 9999px 9999px 0;
        height: 44px;
        transition: all 0.2s;
        flex-shrink: 0;
    }

    #home-search-button:hover {
        background-color: #A98B68;
    }

    .v-header-actions .badge-container {
        position: relative;
    }

    .v-header-actions .badge {
        position: absolute;
        top: -5px;
        right: -8px;
        padding: 2px 5px;
        font-size: 10px;
        border-radius: 9999px;
        background-color: #EF4444;
        color: white;
        font-weight: 700;
        line-height: 1;
    }

    .mobile-header-row-1,
    .mobile-header-row-2 {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .v-header-row-upper {
        gap: 2rem !important;
    }
    
    .v-header-logo {
        min-width: 140px !important;
    }
    
    .v-header-search .relative {
        max-width: 1000px;
    }
    
    .v-header-actions {
        gap: 2rem !important;
    }
}

/* Mobile Menu Side Drawer Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
}

.mobile-menu-overlay.active {
    display: block !important;
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #0d152b;
    z-index: 9999;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
}

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

@media (min-width: 768px) {
    .mobile-menu-content {
        width: 380px; 
        border-right: 1px solid rgba(255,215,0,0.1);
    }
}

/* Square / near-square cards */
.v-card-square {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 400px;
    min-width: 140px;
}

.v-card-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Fluid typography */
.v-title {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
}

.v-price {
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 700;
}

/* Hide long / low-priority content on small screens */
@media (max-width: 767px) {
    .v-hide-on-mobile {
        display: none !important;
    }
}

/* Grid helpers for product/category listings (mobile-first) */
.v-grid-products {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 480px) {
    .v-grid-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .v-grid-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .v-grid-products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Hide scrollbars in horizontal scrollers where we use pill navigations */
.hide-scrollbar {
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
/* ============================== */
/* Virtuosa Mobile Header Structure */
/* (320px-480px Amazon-style)      */
/* ============================== */

/* Mobile Header Row 1: Utilities and Branding */
.mobile-header-row-1 {
    padding: 12px 12px 0 12px;
}

.mobile-header-row-1 .flex {
    padding-bottom: 12px;
}

.mobile-logo {
    font-size: clamp(1.25rem, 4.5vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.mobile-header-actions {
    gap: 0.5rem;
}

.mobile-auth-icon {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-auth-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Show "Sign in" label on screens 480px and up */
@media (min-width: 480px) {
    .mobile-auth-label {
        display: inline !important;
    }
}

/* Mobile Header Row 2: Search-First Experience */
.mobile-header-row-2 {
    padding: 0 12px;
}

.mobile-search-container {
    width: 100%;
}

.mobile-search-input {
    height: 44px;
    font-size: 0.875rem;
    padding: 0 3rem 0 1rem;
    border-radius: 12px;
    background: #1f2937;
    border: 1px solid #374151;
    transition: all 0.2s ease;
}

.mobile-search-input:focus {
    background: #111827;
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.mobile-search-button {
    right: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
}

.mobile-search-button:hover {
    background: rgba(255, 215, 0, 0.1);
}



.mobile-menu-content {
    background: #0A1128;
    min-height: 100vh;
    padding: 1rem;
}

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

.mobile-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    cursor: pointer;
}

.mobile-menu-section {
    margin-bottom: 2rem;
}

.mobile-menu-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.75rem;
    padding: 0 1rem;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: background 0.2s ease;
    gap: 0.75rem;
}

.mobile-menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-link i {
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

/* Cart badge styling for mobile */
.cart-badge-count {
    min-width: 18px;
    height: 18px;
    font-size: 0.625rem;
    font-weight: 700;
}

/* Responsive adjustments for very small screens (320px-359px) */
@media (max-width: 359px) {
    .mobile-header-row-1 {
        padding: 12px 8px 0 8px;
    }
    
    .mobile-header-row-1 .flex {
        padding-bottom: 12px;
    }
    
    .mobile-header-row-2 {
        padding: 0 8px 12px 8px;
    }
    
    .mobile-header-actions {
        gap: 0.375rem;
    }
    
    .mobile-logo {
        font-size: 1.125rem;
    }
    
    .mobile-search-input {
        height: 40px;
        font-size: 0.8rem;
    }
}

/* Responsive adjustments for medium screens (480px-767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .mobile-header-row-1 {
        padding: 12px 16px 0 16px;
    }
    
    .mobile-header-row-1 .flex {
        padding-bottom: 12px;
    }
    
    .mobile-header-row-2 {
        padding: 0 16px 12px 16px;
    }
    
    .mobile-search-input {
        height: 48px;
        font-size: 0.9375rem;
    }
}

/* Sub Navigation Category Menu Responsive Behavior */
.nav-category-menu {
    display: none; /* Hidden by default */
}

@media (max-width: 767px) {
    /* Hide entire category menu section on mobile (mobile header is active) */
    .nav-category-menu {
        display: none !important;
    }
    
    /* Hide category label on products page */
    .nav-category-label {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Show category menu on tablets (mobile header is hidden, desktop header is active) */
    .nav-category-menu {
        display: flex !important;
    }
    
    /* Hide some category links to save space on tablets */
    .nav-category-menu .category-link:nth-child(n+4) {
        display: none;
    }
    
    /* Show category label on products page */
    .nav-category-label {
        display: inline;
    }
}

@media (min-width: 1024px) {
    /* Show all categories on desktop */
    .nav-category-menu .category-link {
        display: inline-block !important;
    }
}

/* Hide desktop header on mobile */
@media (max-width: 767px) {
    .v-header-row:not(.mobile-header-row-1):not(.mobile-header-row-2),
    .desktop-header {
        display: none !important;
    }
}

/* Hide mobile-specific elements on desktop */
@media (min-width: 768px) {
    .mobile-header-row-1,
    .mobile-header-row-2 {
        display: none !important;
    }
    
    .v-header-row,
    .desktop-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        padding: 8px 0 !important;
        min-height: 48px !important;
        position: relative;
    }
    
    /* More specific rules to override everything */
    header .v-container.v-header-row.desktop-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 1rem !important;
        padding: 8px 0 !important;
        min-height: 48px !important;
        position: relative;
    }
    
    
    /* Sub navigation alignment */
    nav.bg-dark-navy .container.mx-auto .flex.items-center {
        display: flex !important;
        align-items: center !important; /* Ensure Hot Deals, Best Sellers, Become a Seller are in straight line */
    }
    
    nav.bg-dark-navy .container.mx-auto .flex.items-center.space-x-4 {
        display: flex !important;
        align-items: center !important;
    }
}

/* ============================== */
/* Virtuosa Mobile-First Foundation */
/* (Amazon-style survival priorities) */
/* ============================== */

:root {
    --v-touch: 44px;
    --v-body-min: 14px;
}

/* Breakpoint-aware styling hooks */
html[data-v-bp="sm"],
html[data-v-bp="mobile"],
html[data-v-bp="tablet"],
html[data-v-bp="desktop"],
html[data-v-bp="wide"] {
    /* These attributes can be used for JavaScript-driven breakpoint detection */
    /* Add breakpoint-specific styles here as needed */
    box-sizing: border-box; /* Temporary fix to avoid empty ruleset */
}

/* Touch targets */
.v-touch {
    min-width: var(--v-touch);
    min-height: var(--v-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Priority-based hiding helpers (CSS-only). */
@media (max-width: 479px) {
    .v-hide-sm {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .v-hide-mobile {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .v-hide-tablet {
        display: none !important;
    }
}

/* Line clamp utilities (Tailwind CDN often lacks the plugin). */
.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* Media rules: square-first like Amazon listings. */
.v-media-square {
    aspect-ratio: 1 / 1;
    width: 100%;
    background: #FFFFFF;
    overflow: hidden;
}

.v-media-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Main product images should avoid cropping (Amazon-style). */
.v-img-main {
    object-fit: contain !important;
    background: #FFFFFF;
}

/* CTA: allow icon-only collapse on smallest screens. */
.v-cta {
    min-height: var(--v-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.v-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.v-cta__label {
    display: inline;
}

@media (max-width: 479px) {
    .v-cta__label {
        display: none;
    }
}

/* Header: keep a single row; search is highest priority and should expand. */
.v-header-row {
    flex-wrap: nowrap;
}

.v-header-search {
    flex: 1 1 auto;
    min-width: 200px; /* Increased from 140px for accommodative behavior */
    max-width: 600px; /* Make search bar wider */
}

.v-header-logo a {
    font-size: clamp(1.15rem, 5vw, 1.75rem);
}

.v-header-actions a,
.v-header-actions button {
    min-height: var(--v-touch);
}

@media (max-width: 479px) {
    .v-header-row {
        gap: 0.5rem;
    }

    .v-header-actions {
        gap: 0.35rem;
    }
}

/* Grid: mobile-first, drop columns instead of shrinking below tap targets. */
.v-grid-products {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 480px) {
    .v-grid-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .v-grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .v-grid-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .v-grid-products { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1440px) {
    .v-grid-products { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Scrollbar Utilities */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Navigation Row 2 Styles */
.nav-category-item {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #9ca3af; /* gray-400 */
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-category-item:hover {
    color: var(--gold);
}

/* Search suggestions positioning - Global fix for all pages */
.mobile-search-container,
.v-header-search {
    position: relative;
}

#mobile-search-suggestions,
#home-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    z-index: 50;
    transform: translateY(0);
}

/* Desktop specific positioning */
.v-header-search #home-search-suggestions {
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.nav-row-2-container {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Desktop-only utility: hides on mobile, shows on md+ screens.
   Needed because .hidden uses !important which overrides Tailwind's md:block. */
.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }
}
