/**
 * ESP Shop Styles
 *
 * PaulB-inspired category grid and product styling
 * Extends homepage.css base styles
 */

/* Alpine.js cloak - hide elements until Alpine initializes */
[x-cloak] {
    display: none !important;
}

/* ============================================
   Shop Page Body
   ============================================ */
.esp-shop-body {
    margin: 0;
    padding: 0;
    font-family: var(--esp-font-sans);
    background: var(--esp-bg);
}

/* Active nav state for shop page */
.esp-nav__active a {
    color: var(--esp-primary) !important;
    border-bottom-color: var(--esp-primary);
}

/* ============================================
   Shop Categories Dropdown Navigation
   ============================================ */
.esp-nav__dropdown {
    position: relative;
}

.esp-nav__dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.esp-nav__caret {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.esp-nav__dropdown:hover .esp-nav__caret {
    transform: rotate(180deg);
}

.esp-nav__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 800px;
    background: white;
    border: 1px solid var(--esp-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    margin-top: 0;
}

/* Invisible buffer zone to prevent accidental close */
.esp-nav__dropdown-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
}

.esp-nav__dropdown-inner {
    display: flex;
    gap: 2rem;
}

/* Categories column - single column on left, full height, no scroll */
.esp-nav__dropdown-categories {
    flex: 0 0 auto;
    min-width: 280px;
    overflow: visible !important;
    max-height: none !important;
}

.esp-nav__dropdown-col {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: visible !important;
}

.esp-nav__dropdown-col li {
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.esp-nav__dropdown-col a {
    display: block;
    padding: 0.375rem 0.5rem;
    color: var(--esp-text);
    text-decoration: none;
    font-size: 0.9375rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.esp-nav__dropdown-col a:hover {
    background-color: var(--esp-primary-light);
    color: var(--esp-primary-dark);
}

/* Promo images column - stacked on right */
.esp-nav__dropdown-promos {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.esp-nav__dropdown-promo {
    display: block;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.esp-nav__dropdown-promo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.esp-nav__dropdown-promo img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Simple dropdown variant (for About, etc.) */
.esp-nav__dropdown-menu--simple {
    min-width: auto;
    width: auto;
    padding: 0.5rem 0;
}

.esp-nav__dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.esp-nav__dropdown-list li {
    margin: 0;
    padding: 0;
}

.esp-nav__dropdown-list a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--esp-text);
    text-decoration: none;
    font-size: 0.9375rem;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.esp-nav__dropdown-list a:hover {
    background-color: var(--esp-primary-light);
    color: var(--esp-primary-dark);
}

/* Responsive adjustments for dropdown */
@media (max-width: 1023px) {
    .esp-nav__dropdown-menu {
        min-width: 100%;
        left: 0;
        transform: none;
        border-radius: 0;
    }

    .esp-nav__dropdown-menu--simple {
        min-width: auto;
        width: auto;
    }

    .esp-nav__dropdown-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .esp-nav__dropdown-categories {
        flex: none;
    }

    .esp-nav__dropdown-promos {
        flex-direction: row;
        gap: 0.5rem;
    }

    .esp-nav__dropdown-promo {
        flex: 1;
    }
}

/* ============================================
   Shop Header (Page Title)
   ============================================ */
.esp-shop-header {
    padding: var(--esp-space-6) 0 var(--esp-space-4);
    background-color: var(--esp-bg);
}

@media (min-width: 768px) {
    .esp-shop-header {
        padding: var(--esp-space-8) 0 var(--esp-space-6);
    }
}

@media (min-width: 1024px) {
    .esp-shop-header {
        padding: var(--esp-space-10) 0 var(--esp-space-8);
    }
}

.esp-shop-header__title-wrap {
    width: 100%;
}

.esp-shop-header__title {
    font-family: var(--esp-font-heading);
    font-size: var(--esp-text-3xl);         /* 1.875rem / 30px */
    font-weight: var(--esp-font-bold);      /* 700 - standardized */
    /* Title case - no text-transform */
    color: #111827;                          /* Black text per design */
    margin: 0;
    padding-bottom: 0.125rem;
    line-height: var(--esp-leading-snug);   /* 1.375 */
    letter-spacing: var(--esp-tracking-wider); /* 0.05em */
}

/* Override browse-root inline styles for page title */
.esp-browse-root__title {
    color: #111827 !important;              /* Black text per design */
    text-transform: none !important;        /* Title case, not uppercase */
}

@media (min-width: 768px) {
    .esp-shop-header__title {
        font-size: var(--esp-text-4xl);     /* 2.25rem / 36px */
        padding-bottom: 0.1875rem;
    }
}

@media (min-width: 1024px) {
    .esp-shop-header__title {
        font-size: var(--esp-text-5xl);     /* 3rem / 48px */
    }
}

@media (min-width: 1280px) {
    .esp-shop-header__title {
        font-size: var(--esp-text-6xl);     /* 3.75rem / 60px */
    }
}

/* ============================================
   Shop Categories Section
   ============================================ */
.esp-shop-categories {
    padding: var(--esp-space-6) 0 var(--esp-space-12);
    background-color: var(--esp-bg);
}

@media (min-width: 768px) {
    .esp-shop-categories {
        padding: var(--esp-space-8) 0 var(--esp-space-16);
    }
}

/* ============================================
   Category Group Sections
   ============================================ */
.esp-shop-group {
    margin-bottom: var(--esp-space-10);
    padding-bottom: var(--esp-space-8);
    border-bottom: 1px solid var(--esp-border);
}

.esp-shop-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.esp-shop-group__title {
    font-family: var(--esp-font-heading);
    font-size: var(--esp-text-xl);              /* 1.25rem / 20px */
    font-weight: var(--esp-font-bold);          /* 700 */
    color: var(--esp-text);
    margin: 0 0 var(--esp-space-6);
    padding-bottom: var(--esp-space-3);
    border-bottom: 3px solid var(--esp-primary);
    display: inline-block;
}

@media (min-width: 768px) {
    .esp-shop-group {
        margin-bottom: var(--esp-space-12);
        padding-bottom: var(--esp-space-10);
    }

    .esp-shop-group__title {
        font-size: var(--esp-text-2xl);         /* 1.5rem / 24px */
        margin-bottom: var(--esp-space-8);
    }
}

@media (min-width: 1024px) {
    .esp-shop-group__title {
        font-size: var(--esp-text-3xl);         /* 1.875rem / 30px */
    }
}

/* ============================================
   Catalog View - Mobile-First List Layout
   ============================================ */

/* Gold Accent Bar Headings */
.esp-catalog-heading {
    display: flex;
    align-items: center;
    margin-bottom: var(--esp-space-6);
}

.esp-catalog-heading__bar {
    width: 0.375rem;
    height: 1.5rem;
    background-color: var(--esp-primary);
    margin-right: var(--esp-space-3);
    border-radius: 9999px;
    flex-shrink: 0;
}

.esp-catalog-heading__bar--lg {
    height: 2rem;
}

.esp-catalog-heading .esp-shop-header__title,
.esp-catalog-heading .esp-shop-group__title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Catalog Card - Horizontal Row */
.esp-catalog-card {
    display: flex;
    align-items: stretch !important;          /* Stretch image to fill full height */
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb !important;    /* Lighter border per design */
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05);
    padding: 0 !important;                    /* No padding - image flush to edge */
    padding-left: 4rem !important;            /* Reserve space for absolute image (mobile) */
    margin-bottom: 0.75rem;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    overflow: hidden;                         /* Clip image to rounded corners */
    position: relative;                       /* For absolute image positioning */
}

.esp-catalog-card:hover {
    background-color: #f9fafb;
    box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.08);
}

.esp-catalog-card:active {
    background-color: #f3f4f6;
}

.esp-catalog-card__image {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 4rem !important;                   /* Match padding-left on card (mobile) */
    height: 100% !important;                  /* Fill full card height */
    overflow: hidden;
    /* No background - let image fill completely */
}

.esp-catalog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.esp-catalog-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    padding: 0 0.75rem;
    min-width: 0;
    height: 80%;                              /* 80% of card/image height */
}

.esp-catalog-card__title {
    font-family: var(--esp-font-heading);
    font-size: 0.9375rem;                     /* 15px - slightly smaller */
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0;
}

.esp-catalog-card__subtitle {
    font-size: 0.8125rem;                     /* 13px - slightly smaller */
    font-weight: 500;
    color: #6b7280;
    line-height: 1.2;
    margin: 0.0625rem 0 0 0;                  /* 1px top margin */
}

.esp-catalog-card__chevron {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--esp-primary);
    flex-shrink: 0;
    margin-right: 0.25rem;
}

/* List Container - responsive widths */
.esp-shop-list {
    max-width: 28rem;    /* 448px mobile */
    margin: 0 auto;
}

/* Tablet: Slightly larger */
@media (min-width: 640px) {
    .esp-shop-list {
        max-width: 32rem;    /* 512px */
    }

    .esp-catalog-card {
        padding-left: 4.5rem !important;
    }

    .esp-catalog-card__image {
        width: 4.5rem !important;
    }

    .esp-catalog-card__title {
        font-size: 1rem;
    }

    .esp-catalog-card__subtitle {
        font-size: 0.875rem;
    }
}

/* Desktop: Wider container */
@media (min-width: 1024px) {
    .esp-shop-list {
        max-width: 36rem;    /* 576px */
    }

    .esp-catalog-card {
        padding-left: 5rem !important;
    }

    .esp-catalog-card__image {
        width: 5rem !important;
    }

    .esp-catalog-card__title {
        font-size: 1.0625rem;                 /* 17px */
    }

    .esp-catalog-card__subtitle {
        font-size: 0.9375rem;                 /* 15px */
    }
}

/* XL: Even wider */
@media (min-width: 1280px) {
    .esp-shop-list {
        max-width: 42rem;    /* 672px */
    }
}

/* ============================================
   Category Grid (PaulB Pattern) - LEGACY/HIDDEN
   ============================================ */

/* Hide the old grid - using catalog list view instead */
.esp-shop-grid {
    display: none !important;
}

/* ============================================
   Category Grid (PaulB Pattern) - LEGACY STYLES
   Kept for potential future use
   ============================================ */
.esp-shop-grid {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
    .esp-shop-grid {
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .esp-shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .esp-shop-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .esp-shop-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============================================
   Category Card (PaulB Pattern)
   ============================================ */
.card {
    background: white;
    border-radius: 0.25rem;
    padding: 0.5rem;
}

@media (min-width: 640px) {
    .card {
        padding: 1rem;
    }
}

.card-interactive {
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    border: 1px solid #e5e7eb;
}

.card-interactive:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-color: var(--esp-border);
    transform: translateY(-2px);
}

.card-interactive:focus-within {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 0 0 4px var(--esp-primary-light);
}

.product-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.product-item-photo {
    display: block;
    margin: 0 auto;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.product-image-photo {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 0.25rem;
    transition: transform 0.2s ease;
}

@media (min-width: 768px) {
    .product-image-photo {
        max-width: 250px;
    }
}

@media (min-width: 1280px) {
    .product-image-photo {
        max-width: 300px;
    }
}

.card-interactive:hover .product-image-photo {
    transform: scale(1.03);
}

.product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
}

.product-item-link {
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    color: var(--esp-text);
    text-decoration: none;
    line-height: var(--esp-leading-snug);   /* 1.375 */
    display: block;
    transition: color 0.15s ease;
}

@media (min-width: 768px) {
    .product-item-link {
        font-size: var(--esp-text-base);    /* 1rem / 16px */
    }
}

@media (min-width: 1024px) {
    .product-item-link {
        font-size: var(--esp-text-lg);      /* 1.125rem / 18px */
    }
}

.product-item-link:hover {
    color: var(--esp-primary);
}

.product-count {
    font-size: var(--esp-text-xs);          /* 0.75rem / 12px */
    color: var(--esp-text-light);
    margin-top: 0.25rem;
}

@media (min-width: 768px) {
    .product-count {
        font-size: var(--esp-text-sm);      /* 0.875rem / 14px */
    }
}

/* ============================================
   Utility Classes (PaulB Tailwind Pattern)
   ============================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.w-full { width: 100%; }
.grow { flex-grow: 1; }
.block { display: block; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.text-center { text-align: center; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-gray-500 { color: #6b7280; }
.leading-snug { line-height: 1.375; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.object-contain { object-fit: contain; }

/* ============================================
   Shop CTA Variations
   ============================================ */
.esp-shop-cta--alt {
    background-color: var(--esp-bg-alt);
}

.esp-shop-cta__content--centered {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.esp-shop-cta__buttons--centered {
    justify-content: center !important;
}

/* ============================================
   No Categories Message
   ============================================ */
.esp-no-categories {
    text-align: center;
    color: var(--esp-text-light);
    padding: var(--esp-space-12) 0;
    font-size: 1.125rem;
}

/* ============================================
   Cart Link (Header)
   Now a button for drawer trigger
   ============================================ */
.esp-cart-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: var(--esp-text) !important;
    transition: color 0.15s ease;
    gap: 0.25rem;
    /* Button reset - !important to override WooCommerce/theme styles */
    background: none !important;
    border: none !important;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.esp-cart-link:hover {
    color: var(--esp-primary) !important;
}

.esp-cart-link svg {
    width: 28px;
    height: 28px;
}

@media (min-width: 768px) {
    .esp-cart-link svg {
        width: 32px;
        height: 32px;
    }
}

.esp-cart-link span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Cart Icon Wrapper - positions badge relative to icon */
.esp-cart-icon-wrapper {
    position: relative !important;
    display: inline-block !important;
}

/* Cart Count Badge - ESP brand gold (explicit to override theme) */
.esp-cart-count,
.esp-header .esp-cart-count,
.esp-cart-link .esp-cart-count,
.esp-cart-icon-wrapper .esp-cart-count,
span.esp-cart-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 1.25rem !important;
    height: 1.25rem !important;
    padding: 0 0.375rem !important;
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #ffffff !important;
    background-color: #E6AC2C !important; /* ESP Gold */
    border-radius: 9999px !important;
    position: absolute !important;
    top: -0.25rem !important;
    right: -0.25rem !important;
}

/* Cart Label - hidden on mobile, shown on desktop like PaulB */
.esp-cart-label {
    display: none; /* Hidden on mobile */
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .esp-cart-label {
        display: block; /* Show on desktop */
    }
}

/* Position the cart link relatively for absolute badge positioning */
.esp-cart-link {
    position: relative;
}

/* ============================================
   Shop Categories Button Override
   Matches .esp-nav__menu li a styling for vertical alignment
   !important needed to override WooCommerce/theme styles
   ============================================ */

/* Make the button's parent li a flex container to center the button vertically */
.esp-nav__item {
    display: flex !important;
    align-items: center !important;
}

.esp-nav__products-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: var(--esp-space-3) !important; /* Match nav link padding */
    background: transparent !important;
    border: none !important;
    color: var(--esp-gray-700) !important;
    font-family: var(--esp-font-sans) !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: color var(--esp-transition) !important;
}

.esp-nav__products-btn:hover {
    color: var(--esp-primary) !important;
}

.esp-nav__products-btn .esp-nav__caret {
    color: inherit !important;
    width: 16px !important;
    height: 16px !important;
    transition: transform var(--esp-transition) !important;
}

@media (min-width: 768px) {
    .esp-nav__products-btn {
        font-size: 1.125rem !important; /* text-lg - match nav links */
    }
}

@media (min-width: 1024px) {
    .esp-nav__products-btn {
        font-size: 1rem !important; /* Reduced for 1024-1400px to match nav links */
        padding: var(--esp-space-2) !important;
    }
}

@media (min-width: 1400px) {
    .esp-nav__products-btn {
        font-size: 1.25rem !important; /* text-xl - match nav links */
        padding: var(--esp-space-3) !important;
    }
}

/* ============================================
   Search Bar Button Overrides
   !important needed to override WooCommerce/theme styles
   ============================================ */
.esp-search__barcode,
.esp-search__chat,
.esp-search__quickorder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 100% !important;
    padding: 0 8px !important;
    background: transparent !important; /* Inherits grey from parent input-wrap */
    border: none !important;
    color: #1f2937 !important;
}

.esp-search__barcode:hover,
.esp-search__chat:hover,
.esp-search__quickorder:hover {
    color: var(--esp-primary) !important;
}

/* Search submit button - gold gradient with rounded right side */
.esp-search__btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 1.75rem !important;
    background: linear-gradient(to bottom, #EDBA2E 0%, #D49A1A 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 9999px 9999px 0 !important;
    cursor: pointer !important;
    margin: 0 3px 0 0 !important; /* Right margin to align curve with outer pill */
}

.esp-search__btn:hover {
    background: linear-gradient(to bottom, #D9A520 0%, #B8850F 100%) !important;
}

.esp-search__btn svg {
    width: 28px !important;
    height: 28px !important;
    stroke: #ffffff !important;
    fill: none !important;
}

/* ============================================
   Breadcrumbs
   ============================================ */
.esp-breadcrumbs {
    background-color: var(--esp-bg-alt);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.esp-breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: var(--esp-space-4) 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: var(--esp-text-sm);          /* 0.875rem / 14px */
    color: var(--esp-text-light);
}

.esp-breadcrumbs__item {
    display: flex;
    align-items: center;
}

.esp-breadcrumbs__link {
    color: var(--esp-text-light);
    text-decoration: none;
    transition: color 0.15s ease;
}

.esp-breadcrumbs__link:hover {
    color: var(--esp-primary);
    text-decoration: underline;
}

.esp-breadcrumbs__separator {
    padding: 0 0.5rem;
    color: var(--esp-text-light);
}

.esp-breadcrumbs__current {
    color: var(--esp-text);
    font-weight: var(--esp-font-medium);    /* 500 */
}

/* ============================================
   Top Bar - Phone Only (PaulB Pattern)
   ============================================ */
.esp-topbar__phone {
    display: block;
    font-size: var(--esp-text-base);        /* 1rem / 16px */
    font-weight: var(--esp-font-black);     /* 900 */
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    letter-spacing: var(--esp-tracking-tight); /* -0.025em */
    text-align: center;
    transition: text-decoration 0.15s ease;
}

.esp-topbar__phone:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .esp-topbar__phone {
        text-align: right;
    }
}

@media (min-width: 1024px) {
    .esp-topbar__phone {
        font-size: var(--esp-text-2xl);     /* 1.5rem / 24px */
    }
}

/* ============================================
   Search Bar - Core styles in homepage.css
   Only autocomplete dropdown overrides remain here
   ============================================ */

/* ============================================
   Search Autocomplete Dropdown
   ============================================ */
.esp-search {
    position: relative;
}

.esp-search__autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 70vh;
    overflow: hidden;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .esp-search__autocomplete {
        min-width: 500px;
    }
}

.esp-search__section {
    border-bottom: 1px solid #e5e7eb;
}

.esp-search__section:first-of-type {
    border-radius: 0.5rem 0.5rem 0 0;
}

.esp-search__section:last-child {
    border-bottom: none;
    border-radius: 0 0 0.5rem 0.5rem;
}

.esp-search__section:first-of-type:last-child {
    border-radius: 0.5rem;
}

/* Round corners on first product item when it's the first visible element */
.esp-search__section:first-of-type .esp-search__product-item:first-of-type {
    border-radius: 0.5rem 0.5rem 0 0;
}

.esp-search__section-title {
    display: block;
    padding: 0.5rem 1rem;
    font-size: var(--esp-text-xs);          /* 0.75rem / 12px */
    font-weight: var(--esp-font-semibold);  /* 600 */
    text-transform: uppercase;
    letter-spacing: var(--esp-tracking-wider); /* 0.05em */
    color: var(--esp-text-light);           /* Use variable instead of #6b7280 */
    background: var(--esp-bg-alt);          /* Use variable instead of #f9fafb */
    border-bottom: 1px solid var(--esp-border); /* Use variable instead of #e5e7eb */
}

/* Round corners on section title when it's in the first section */
.esp-search__section:first-of-type .esp-search__section-title {
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Search Term Results */
.esp-search__term-item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--esp-text);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.esp-search__term-item:hover,
.esp-search__term-item.is-selected {
    background-color: #f3f4f6;
}

.esp-search__term-text {
    font-size: 0.9375rem;
    color: var(--esp-text);
}

.esp-search__term-count {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-left: 0.5rem;
}

/* Product Results */
.esp-search__product-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.esp-search__product-item:hover,
.esp-search__product-item.is-selected {
    background-color: #f3f4f6;
}

.esp-search__product-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: white;
    border-radius: 0.25rem;
    overflow: hidden;
    margin-right: 0.75rem;
}

.esp-search__product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.esp-search__product-info {
    flex: 1;
    min-width: 0;
}

.esp-search__product-title {
    font-size: 0.875rem;
    color: var(--esp-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.esp-search__product-sku {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

.esp-search__product-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--esp-text);
    margin-top: 0.25rem;
}

.esp-search__product-price del {
    color: #9ca3af;
    font-weight: 400;
    margin-right: 0.5rem;
}

.esp-search__product-price ins {
    text-decoration: none;
    color: #dc2626;
}

/* Category Results */
.esp-search__category-item {
    display: block;
    padding: 0.625rem 1rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.esp-search__category-item:hover,
.esp-search__category-item.is-selected {
    background-color: #f3f4f6;
}

.esp-search__category-breadcrumb {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    margin-bottom: 0.125rem;
}

.esp-search__category-name {
    font-size: 0.9375rem;
    color: var(--esp-text);
}

.esp-search__category-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 0.375rem;
}

/* Loading State */
.esp-search__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.esp-search__loading-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e5e7eb;
    border-top-color: var(--esp-gold);
    border-radius: 50%;
    animation: esp-spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

@keyframes esp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Results */
.esp-search__no-results {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* View All Link */
.esp-search__view-all {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--esp-gold);
    text-decoration: none;
    background: #fefce8;
    border-top: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}

.esp-search__view-all:hover {
    background: #fef9c3;
    color: var(--esp-gold-dark);
}


/* ============================================
   Footer CTA - Phone Only
   ============================================ */
.esp-footer-cta__phone {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    transition: text-decoration 0.15s ease;
}

.esp-footer-cta__phone:hover {
    text-decoration: underline;
}

/* ============================================
   Barcode Scanner Modal
   ============================================ */
.esp-barcode-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.esp-barcode-modal__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.esp-barcode-modal__content {
    position: relative;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 36rem;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .esp-barcode-modal__content {
        max-height: 80vh;
    }
}

.esp-barcode-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.esp-barcode-modal__close:hover {
    background: #e5e7eb;
    color: #374151;
}

.esp-barcode-modal__title {
    margin: 0;
    padding: 1.25rem 1.5rem;
    padding-right: 3.5rem;
    font-size: var(--esp-text-2xl);         /* 1.5rem / 24px */
    font-weight: var(--esp-font-bold);      /* 700 */
    text-transform: uppercase;
    color: var(--esp-primary);
    text-align: center;
    border-bottom: 1px solid var(--esp-border);
}

.esp-barcode-modal__scanner {
    width: 100%;
    min-height: 300px;
    max-height: 400px;
    background: #1f2937;
    overflow: hidden;
    position: relative;
}

@media (min-width: 640px) {
    .esp-barcode-modal__scanner {
        min-height: 360px;
        max-height: 450px;
    }
}

/* Override html5-qrcode default styles */
.esp-barcode-modal__scanner video {
    width: 100% !important;
    height: 100% !important;
    max-height: 100%;
    object-fit: cover;
}

.esp-barcode-modal__scanner #qr-shaded-region {
    border-color: var(--esp-primary) !important;
}

/* Scanner viewfinder styling */
#esp-barcode-scanner {
    width: 100%;
}

#esp-barcode-scanner video {
    width: 100%;
    height: auto;
}

/* QR code scanning region */
#esp-barcode-scanner__scan-region-highlight-svg {
    stroke: var(--esp-gold) !important;
}

.esp-barcode-modal__message {
    margin: 0;
    padding: 1rem 1.5rem;
    font-size: 0.9375rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Error state styling */
.esp-barcode-modal__message.error {
    color: #dc2626;
    background: #fef2f2;
}

/* Scanning indicator animation */
@keyframes esp-scan-line {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(100%);
    }
}

/* Transition utilities for Alpine.js */
.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-150 {
    transition-duration: 150ms;
}

.duration-200 {
    transition-duration: 200ms;
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
}

/* ============================================
   Order Confirmation Page Styles
   ============================================ */

/* Override WooCommerce default link colors (maroon/pink #a46497) */
.esp-order-confirmation-body .woocommerce a,
.esp-order-confirmation-body .woocommerce-order a,
.esp-order-confirmation-body .woocommerce-table--order-details a,
.esp-order-confirmation-body .woocommerce-customer-details a,
.esp-order-confirmation-body .woocommerce-order-overview a,
.esp-order-confirmation-container a {
    color: var(--esp-primary) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.esp-order-confirmation-body .woocommerce a:hover,
.esp-order-confirmation-body .woocommerce-order a:hover,
.esp-order-confirmation-body .woocommerce-table--order-details a:hover,
.esp-order-confirmation-body .woocommerce-customer-details a:hover,
.esp-order-confirmation-body .woocommerce-order-overview a:hover,
.esp-order-confirmation-container a:hover {
    color: var(--esp-primary-dark) !important;
    text-decoration: underline !important;
}

/* Override breadcrumb link colors */
.esp-order-confirmation-body .esp-breadcrumbs a,
.esp-order-confirmation-body .esp-breadcrumbs__item a {
    color: var(--esp-primary) !important;
}

.esp-order-confirmation-body .esp-breadcrumbs a:hover,
.esp-order-confirmation-body .esp-breadcrumbs__item a:hover {
    color: var(--esp-primary-dark) !important;
}

/* Force hamburger menu hidden on desktop - override any conflicting styles */
@media (min-width: 1024px) {
    .esp-order-confirmation-body .esp-mobile-nav-toggle,
    .esp-shop-body .esp-mobile-nav-toggle,
    body .esp-mobile-nav-toggle {
        display: none !important;
    }
}
