/* =====================================================
   BEEF MANIAC - ORDER JERKY PAGE STYLES
   ===================================================== */

/* =====================================================
   PRODUCTS SECTION WITH VIDEO BACKGROUND
   ===================================================== */
.products-section {
    position: relative;
    min-height: 100vh;
    padding: var(--spacing-xl) 0 var(--spacing-3xl);
    /* Account for fixed banner + header */
    padding-top: calc(var(--shipping-banner-height, 0px) + var(--header-height, 70px) + var(--spacing-xs));
}

.products-video-bg {
    position: fixed;
    top: 0;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: -2;
}

.products-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.products-section .container {
    position: relative;
    z-index: 1;
}

.products-section .section-title {
    color: var(--color-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   FILTER BAR OVERRIDES
   ===================================================== */
.products-section .filter-bar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin-bottom: var(--spacing-2xl);
}

/* Filter Toggle Button - hidden by default */
.filter-toggle-btn {
    display: none;
}

/* Mobile filter adjustments */
@media (max-width: 767px) {
    .products-section .filter-bar {
        position: relative;
        z-index: 50;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .products-section .filter-bar .search-box {
        flex: 1;
        min-width: 150px;
    }

    .products-section .filter-bar .sort-dropdown {
        flex-shrink: 0;
        min-width: 130px;
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .products-section .filter-options {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-white);
        padding: var(--spacing-md);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        flex-direction: column;
        gap: var(--spacing-xs);
        z-index: 9999;
        margin-top: 0;
    }

    .products-section .filter-options.active {
        display: flex !important;
    }

    .products-section .filter-options .filter-btn {
        display: block;
        width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
        text-align: center;
        border-radius: var(--radius-md);
        background-color: var(--color-off-white);
        border: none;
        font-size: var(--font-size-sm);
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .products-section .filter-options .filter-btn:hover {
        background-color: var(--color-gray-light);
    }

    .products-section .filter-options .filter-btn.active {
        background-color: var(--color-primary);
        color: var(--color-white);
    }

    .filter-toggle-btn {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        padding: var(--spacing-sm) var(--spacing-md);
        background-color: var(--color-off-white);
        border-radius: var(--radius-md);
        font-size: var(--font-size-sm);
        font-weight: 600;
        cursor: pointer;
        border: none;
        flex-shrink: 0;
    }

    .filter-toggle-btn:hover {
        background-color: var(--color-gray-light);
    }

    .filter-toggle-btn.active {
        background-color: var(--color-primary);
        color: var(--color-white);
    }

    .filter-toggle-btn.active svg {
        stroke: var(--color-white);
    }
}

/* Desktop filter bar adjustments */
@media (min-width: 768px) {
    .products-section .filter-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-md);
        flex-wrap: nowrap;
    }

    .products-section .filter-bar .search-box {
        flex: 0 0 auto;
        min-width: 200px;
        max-width: 250px;
    }

    .products-section .filter-options {
        flex: 1;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-xs);
    }

    .products-section .filter-options .filter-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
        white-space: nowrap;
    }

    .products-section .filter-bar .sort-dropdown {
        flex: 0 0 auto;
        min-width: 150px;
    }
}

/* Large desktop - more space for filter options */
@media (min-width: 1200px) {
    .products-section .filter-bar .search-box {
        max-width: 300px;
    }

    .products-section .filter-options .filter-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }
}

/* =====================================================
   CUSTOMER FAVORITES SECTION
   ===================================================== */
.customer-favorites {
    position: relative;
    z-index: 1;
    margin-bottom: var(--spacing-3xl);
}

.favorites-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

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

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

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

/* =====================================================
   PRODUCT CARD ENHANCEMENTS
   ===================================================== */
.products-section .product-card {
    background-color: var(--color-white);
    padding: var(--spacing-sm);
}

.products-section .product-card h3 {
    font-size: var(--font-size-base);
}

.products-section .product-card .product-contents {
    font-size: var(--font-size-xs);
}

.products-section .product-card .price {
    font-size: var(--font-size-lg);
}

.products-section .product-card .product-image {
    aspect-ratio: 1;
    margin-bottom: var(--spacing-sm);
}

.products-section .product-card .btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* Smaller cards on tablet and desktop */
@media (min-width: 768px) {
    .products-section .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }
}

@media (min-width: 1024px) {
    .products-section .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }
}

@media (min-width: 1400px) {
    .products-section .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.product-card .halal-badge-small {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.product-card .halal-badge-small::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-full);
    font-size: 10px;
}

/* View Details link */
.product-card .view-details {
    display: block;
    text-align: center;
    margin-top: var(--spacing-sm);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.product-card .view-details:hover {
    text-decoration: underline;
}

/* Coming Soon Card */
.product-card.coming-soon {
    opacity: 0.8;
}

.product-card.coming-soon .product-image {
    position: relative;
}

.product-card.coming-soon .product-image::after {
    content: 'Coming Soon';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--color-gray);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--font-size-sm);
}

.product-card.coming-soon .add-to-cart {
    display: none;
}

.notify-me-btn {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-gray-light);
    color: var(--color-secondary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.notify-me-btn:hover {
    background-color: var(--color-gray);
    color: var(--color-white);
}

/* =====================================================
   RECOMMEND CTA SECTION
   ===================================================== */
.recommend-cta {
    margin-top: var(--spacing-3xl);
}

.recommend-cta-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--color-white);
}

@media (min-width: 768px) {
    .recommend-cta-card {
        padding: var(--spacing-3xl);
    }
}

.recommend-cta-content h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
    .recommend-cta-content h2 {
        font-size: var(--font-size-3xl);
    }
}

.recommend-cta-content p {
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.recommend-cta .btn-primary {
    background-color: var(--color-white);
    color: var(--color-primary);
}

.recommend-cta .btn-primary:hover {
    background-color: var(--color-off-white);
}

/* =====================================================
   ALL PRODUCTS SECTION
   ===================================================== */
.all-products {
    position: relative;
    z-index: 1;
    margin-bottom: var(--spacing-2xl);
}

/* Tier dividers */
.tier-section {
    margin-bottom: var(--spacing-2xl);
}

.tier-title {
    color: var(--color-white);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* =====================================================
   NO RESULTS MESSAGE
   ===================================================== */
.no-results {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--color-white);
}

.no-results h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-md);
}

.no-results p {
    margin-bottom: var(--spacing-lg);
}

/* =====================================================
   LOADING STATE
   ===================================================== */
.products-loading {
    display: flex;
    justify-content: center;
    padding: var(--spacing-3xl);
}

/* =====================================================
   MOBILE OPTIMIZATIONS
   ===================================================== */
@media (max-width: 767px) {
    .products-section {
        /* Account for fixed banner + header on mobile */
        padding-top: calc(var(--shipping-banner-height, 0px) + var(--header-height, 70px) + var(--spacing-md));
        /* Add bottom padding for sticky cart button */
        padding-bottom: calc(var(--spacing-3xl) + 80px);
    }

    /* Section title on dark background */
    .products-section .section-title {
        font-size: var(--font-size-2xl);
    }

    /* Filter bar mobile improvements */
    .products-section .filter-bar {
        padding: var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }

    .search-box {
        width: 100%;
    }

    /* Tier section mobile */
    .tier-title {
        font-size: var(--font-size-lg);
    }

    /* Recommend CTA mobile */
    .recommend-cta-card {
        padding: var(--spacing-lg);
    }

    .recommend-cta-content h2 {
        font-size: var(--font-size-xl);
    }
}

/* No results mobile */
@media (max-width: 767px) {
    .no-results {
        padding: var(--spacing-xl);
    }

    .no-results h3 {
        font-size: var(--font-size-xl);
    }
}

/* =====================================================
   FILTER ANIMATIONS
   ===================================================== */

/* Grid fade animations */
.favorites-grid,
.product-grid {
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.favorites-grid.fade-out,
.product-grid.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.favorites-grid.fade-in,
.product-grid.fade-in {
    animation: fadeInUp 0.3s ease-out forwards;
}

/* Card stagger animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.product-card.card-animate {
    animation: cardSlideIn 0.4s ease-out forwards;
    animation-fill-mode: both;
}

/* Customer favorites section transition */
.customer-favorites {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.customer-favorites .section-title {
    transition: opacity 0.2s ease;
}

/* =====================================================
   TOP PICK BADGE & HIGHLIGHT (when filtering)
   ===================================================== */
.badge-top-pick {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

/* Customer favorite highlight when filtering - red brand accent border */
.product-card.top-pick-card {
    border: 2px solid var(--color-primary, #C81E1E);
    box-shadow: var(--shadow-md);
}

/* =====================================================
   PRODUCT CATEGORY SECTIONS - Stacked vertically
   ===================================================== */
#product-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
}

.product-category-section {
    width: 100%;
}

/* Side-by-side category row (Snack Packs + Meal Packs) - Desktop only */
.category-row-side-by-side {
    display: flex;
    gap: var(--spacing-xl);
    width: 100%;
}

.category-row-side-by-side .product-category-section {
    flex: 1;
    min-width: 0;
}

/* Side-by-side sections use normal responsive grid on mobile/tablet */
/* Desktop (1200px+): 2 columns side by side */
@media (min-width: 1200px) {
    .category-row-side-by-side .category-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Third card horizontal layout - DESKTOP ONLY (1200px+) */
@media (min-width: 1200px) {
    .category-row-side-by-side .category-products .product-card:nth-child(3) {
        grid-column: span 2;
        display: grid;
        grid-template-columns: 200px 1fr;
        grid-template-areas:
            "image badges"
            "image halal"
            "image title"
            "image subtitle"
            "image contents"
            "image flavors"
            "image savings"
            "image selector"
            "image pricing"
            "image quantity"
            "image actions"
            "image details";
        gap: var(--spacing-xs) var(--spacing-lg);
        text-align: left;
        padding: var(--spacing-lg);
        align-items: start;
    }

    /* Image area */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-image-link {
        grid-area: image;
        width: 100%;
        align-self: center;
    }

    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-image {
        height: 180px;
        min-height: 180px;
        border-radius: var(--radius-md);
    }

    /* Badges at top right */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .badge {
        position: static;
        display: inline-block;
        margin-right: var(--spacing-xs);
        margin-bottom: var(--spacing-xs);
    }

    /* Halal badge */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .halal-badge-small {
        grid-area: halal;
        margin: 0;
    }

    /* Title */
    .category-row-side-by-side .category-products .product-card:nth-child(3) h3 {
        grid-area: title;
        margin: 0;
        font-size: var(--font-size-lg);
    }

    /* Subtitle */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .bundle-subtitle {
        grid-area: subtitle;
        margin: 0;
    }

    /* Contents */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-contents {
        grid-area: contents;
        margin: 0;
    }

    /* Flavor tags */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .flavor-tags {
        grid-area: flavors;
        justify-content: flex-start;
    }

    /* Savings note */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .bundle-savings-note {
        grid-area: savings;
        margin: var(--spacing-xs) 0;
        text-align: left;
    }

    /* Size selector - horizontal row */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .bundle-size-selector {
        grid-area: selector;
        margin: 0;
        flex-direction: row;
        gap: var(--spacing-xs);
    }

    .category-row-side-by-side .category-products .product-card:nth-child(3) .bundle-size-btn {
        min-height: 50px;
        padding: var(--spacing-xs) var(--spacing-sm);
        flex: 1;
    }
    /* Price */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-pricing {
        grid-area: pricing;
        text-align: left;
        margin: var(--spacing-sm) 0;
    }

    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-pricing .price {
        font-size: var(--font-size-2xl);
    }

    /* Quantity selector */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .quantity-selector {
        grid-area: quantity;
        justify-content: flex-start;
        margin: 0;
    }

    /* Action buttons */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-actions {
        grid-area: actions;
        justify-content: flex-start;
        gap: var(--spacing-sm);
        margin: 0;
    }

    .category-row-side-by-side .category-products .product-card:nth-child(3) .product-actions .btn {
        flex: 0 0 auto;
        padding: var(--spacing-sm) var(--spacing-lg);
    }

    /* View details link */
    .category-row-side-by-side .category-products .product-card:nth-child(3) .view-details {
        grid-area: details;
        text-align: left;
        margin: 0;
    }
}

/* Stack side-by-side sections on tablet and mobile */
@media (max-width: 1199px) {
    .category-row-side-by-side {
        flex-direction: column;
        gap: var(--spacing-2xl);
    }
}

/* On tablets (480-1199px), show 2 columns for side-by-side categories */
@media (min-width: 480px) and (max-width: 1199px) {
    .category-row-side-by-side .category-products {
        grid-template-columns: repeat(2, 1fr);
    }
}

.category-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.category-title {
    color: var(--color-white);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin: 0 0 var(--spacing-xs);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.category-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-base);
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Category products - responsive grid (mobile-first like favorites-grid) */
.category-products {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

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

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

    .category-title {
        font-size: var(--font-size-2xl);
    }
}

@media (min-width: 1024px) {
    .category-products {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Mobile text adjustments */
@media (max-width: 767px) {
    .category-title {
        font-size: var(--font-size-lg);
    }

    .category-description {
        font-size: var(--font-size-sm);
    }
}

/* =====================================================
   BUNDLE CARDS - Multi-pack size selection
   ===================================================== */

.bundle-card {
    position: relative;
}

.bundle-subtitle {
    color: var(--color-gray);
    font-size: var(--font-size-sm);
    margin: 0 0 var(--spacing-xs);
    font-weight: 500;
}

.bundle-savings-note {
    text-align: center;
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    font-weight: 700;
    margin: var(--spacing-sm) 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.08) 0%, rgba(196, 30, 58, 0.04) 100%);
    border-radius: var(--radius-sm);
}

/* Bundle Size Selector - horizontal button group */
.bundle-size-selector {
    display: flex;
    gap: var(--spacing-xs);
    margin: var(--spacing-md) 0;
    width: 100%;
}

.bundle-size-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-xs);
    background-color: var(--color-off-white);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
}

.bundle-size-btn:hover {
    background-color: var(--color-gray-light);
    border-color: var(--color-gray);
}

.bundle-size-btn.active {
    background-color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
}

.bundle-size-btn .size-label {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 2px;
}

.bundle-size-btn .per-bag {
    font-size: var(--font-size-xs);
    color: var(--color-gray);
}

.bundle-size-btn .savings {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-primary);
    background-color: rgba(196, 30, 58, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.bundle-size-btn.active .size-label {
    color: var(--color-primary);
}

/* Bundle price display */
.bundle-price {
    transition: all 0.2s ease;
}

/* Bundle contents transition */
.bundle-contents {
    transition: all 0.2s ease;
}

/* Mobile adjustments for bundle cards */
@media (max-width: 480px) {
    .bundle-size-selector {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .bundle-size-btn {
        flex-direction: row;
        justify-content: space-between;
        padding: var(--spacing-sm) var(--spacing-md);
        min-height: auto;
    }

    .bundle-size-btn .size-label {
        flex: 0 0 auto;
    }

    .bundle-size-btn .per-bag {
        flex: 1;
        text-align: center;
    }

    .bundle-size-btn .savings {
        flex: 0 0 auto;
    }
}

/* Slightly larger bundle cards to fit content */
@media (min-width: 768px) {
    .bundle-card {
        min-width: 280px;
    }
}
