/* 3 Strands Cattle Co. - Markets Display CSS */
/* Viewport-unit based sizing for consistent display across all TVs/monitors */

:root {
    /* Primary Brand Colors - Dark Copper/Bronze (TV-friendly, not red) */
    --primary-black: #0a0a0a;
    --primary-rust: #7A5C3E;
    --accent-rust: #8B6914;
    --dark-rust: #5C4425;
    --light-rust: #A67C52;

    /* Extended Palette */
    --bg-dark: #000000;
    --bg-card: #111111;
    --bg-card-hover: #1a1a1a;
    --border-dark: #222222;
    --border-rust: rgba(122, 92, 62, 0.3);

    /* Text Colors */
    --text-white: #ffffff;
    --text-light: #e0e0e0;
    --text-muted: #888888;
    --text-rust: #7A5C3E;

    /* Functional Colors */
    --sale-red: #ff3333;
    --sale-red-light: #ff6666;
    --success-green: #00cc66;

    /* Stock Status Colors */
    --sold-out-red: #dc2626;
    --low-stock-yellow: #f59e0b;
    --in-stock-green: #22c55e;

    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-rust: 0 4px 20px rgba(122, 92, 62, 0.3);
    --glow-rust: 0 0 20px rgba(122, 92, 62, 0.4);

    /* Layout */
    --menu-columns: 4;
}

/* =============================================================================
   Light Mode Theme
   ============================================================================= */

body.light-mode {
    --bg-dark: #f5f5f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f8f5;
    --border-dark: #d4d0c8;
    --border-rust: rgba(122, 92, 62, 0.4);
    --text-white: #1a1a1a;
    --text-light: #333333;
    --text-muted: #666666;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-rust: 0 4px 20px rgba(122, 92, 62, 0.2);
    --glow-rust: 0 0 20px rgba(122, 92, 62, 0.3);
}

body.light-mode .markets-container {
    background: linear-gradient(180deg, #f5f5f0 0%, #ebe8e0 100%);
}

body.light-mode .markets-header {
    background: linear-gradient(90deg, #ffffff 0%, #f8f8f5 50%, #ffffff 100%);
    border-bottom-color: var(--primary-rust);
}

body.light-mode .watermark-logo {
    opacity: 0.05;
}

body.light-mode .brand-info h1 {
    text-shadow: 0 0 10px rgba(122, 92, 62, 0.2);
}

body.light-mode .menu-category {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.light-mode .menu-item .item-info::after {
    border-bottom-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .menu-item .item-pricing {
    background: var(--bg-card);
}

body.light-mode .menu-item.on-sale .item-pricing {
    background: transparent;
}

body.light-mode .events-ticker {
    background: linear-gradient(90deg, #ffffff, #f8f8f5, #ffffff);
}

body.light-mode .back-button {
    background: rgba(255, 255, 255, 0.9);
}

body.light-mode .menu-item.on-sale {
    background: linear-gradient(90deg, rgba(122, 92, 62, 0.12), rgba(166, 124, 82, 0.08));
    border-left-color: var(--primary-rust);
    animation: flashPulseLight 2s ease-in-out infinite;
}

body.light-mode .menu-item.on-sale .item-info::after {
    border-bottom-color: rgba(122, 92, 62, 0.25);
}

body.light-mode .menu-item .item-price.sale {
    color: #8B4513;
    text-shadow: none;
}

body.light-mode .flash-badge {
    background: linear-gradient(135deg, var(--primary-rust), var(--dark-rust));
    color: #ffffff;
}

body.light-mode .menu-item.on-sale .item-name {
    color: var(--text-light);
}

body.light-mode .ticker-flash-sale {
    background: linear-gradient(90deg, rgba(122, 92, 62, 0.15), rgba(166, 124, 82, 0.1));
}

body.light-mode .ticker-flash-label {
    color: var(--primary-rust);
}

body.light-mode .ticker-flash-price {
    color: #8B4513;
}

body.light-mode .ticker-flash-sale i {
    color: var(--primary-rust);
}

body.light-mode .stock-indicator.low {
    background: rgba(180, 120, 40, 0.15);
    color: #996515;
}

body.light-mode .stock-badge.low-stock {
    background: rgba(180, 120, 40, 0.15);
    color: #996515;
    border-color: #996515;
}

body.light-mode .theme-toggle-btn:hover {
    color: #ffffff;
}

@keyframes flashPulseLight {
    0%, 100% {
        background: linear-gradient(90deg, rgba(122, 92, 62, 0.12), rgba(166, 124, 82, 0.08));
    }
    50% {
        background: linear-gradient(90deg, rgba(122, 92, 62, 0.18), rgba(166, 124, 82, 0.12));
    }
}

/* =============================================================================
   Base Reset
   ============================================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Lato', sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
}

/* =============================================================================
   Back Button
   ============================================================================= */

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary-rust);
    color: var(--primary-rust);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-button:hover,
body:hover .back-button {
    opacity: 1;
}

.back-button:hover {
    background: var(--primary-rust);
    color: var(--bg-dark);
    transform: scale(1.1);
    box-shadow: var(--glow-rust);
}

.is-fullscreen .back-button {
    display: none;
}

/* =============================================================================
   Main Container & Watermark
   ============================================================================= */

.markets-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, #0a0a0a 0%, #000000 100%);
    position: relative;
}

.watermark-logo {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('/static/market-logo.png');
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center center;
    opacity: 0.07;
    pointer-events: none;
    z-index: 1;
}

/* =============================================================================
   Header Banner - Viewport Unit Sizing
   ============================================================================= */

.markets-header {
    background: linear-gradient(90deg, #000000 0%, #111111 50%, #000000 100%);
    padding: clamp(8px, 1.2vh, 30px) clamp(20px, 3vw, 80px);
    border-bottom: clamp(2px, 0.3vh, 4px) solid var(--primary-rust);
    box-shadow: var(--shadow-medium), 0 3px 15px rgba(122, 92, 62, 0.2);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.5vw, 25px);
}

.header-logo {
    width: clamp(40px, 6vh, 140px);
    height: clamp(40px, 6vh, 140px);
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(122, 92, 62, 0.5));
}

.brand-info h1 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.2rem, 3.5vh, 4.5rem);
    font-weight: 600;
    color: var(--primary-rust);
    text-shadow: 0 0 20px rgba(122, 92, 62, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tagline {
    font-size: clamp(0.5rem, 1.2vh, 1.5rem);
    color: var(--text-light);
    font-weight: 300;
    letter-spacing: clamp(1px, 0.2vw, 3px);
    text-transform: uppercase;
    margin-top: clamp(1px, 0.3vh, 5px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 15px);
}

.market-location-picker {
    display: flex;
    align-items: center;
    gap: clamp(5px, 0.5vw, 9px);
    min-width: clamp(150px, 14vw, 270px);
    padding: clamp(5px, 0.8vh, 16px) clamp(8px, 0.9vw, 20px);
    border: 2px solid var(--primary-rust);
    border-radius: 12px;
    color: var(--primary-rust);
    background: rgba(0, 0, 0, 0.2);
    font-family: 'Lato', sans-serif;
    font-size: clamp(0.55rem, 1.1vh, 1.5rem);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.market-location-picker select {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    color: var(--text-white);
    background: transparent;
    font: inherit;
    text-transform: none;
    cursor: pointer;
}

.market-location-picker select option {
    color: #f5f0e1;
    background: #100d0a;
}

body.light-mode .market-location-picker {
    background: rgba(255, 255, 255, 0.7);
}

body.light-mode .market-location-picker select,
body.light-mode .market-location-picker select option {
    color: #1a1a1a;
    background: #ffffff;
}

/* Header Buttons - Shared */
.fullscreen-btn,
.theme-toggle-btn,
.cow-map-btn {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.5vw, 10px);
    padding: clamp(6px, 1vh, 22px) clamp(10px, 1.2vw, 40px);
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: clamp(0.55rem, 1.1vh, 1.5rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fullscreen-btn,
.theme-toggle-btn {
    background: transparent;
    border: 2px solid var(--primary-rust);
    color: var(--primary-rust);
}

.fullscreen-btn:hover,
.theme-toggle-btn:hover {
    background: var(--primary-rust);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-rust), var(--glow-rust);
}

.fullscreen-btn i,
.theme-toggle-btn i {
    font-size: clamp(0.6rem, 1.2vh, 1.3rem);
    transition: transform 0.3s ease;
}

.cow-map-btn {
    background: linear-gradient(135deg, var(--primary-rust), var(--dark-rust));
    border: none;
    color: var(--text-white);
}

.cow-map-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-rust), var(--glow-rust);
}

.cow-map-btn i {
    font-size: clamp(0.7rem, 1.4vh, 1.5rem);
}

/* Hide fullscreen button text when in fullscreen mode */
:fullscreen .fullscreen-btn span,
:-webkit-full-screen .fullscreen-btn span {
    display: none;
}

:fullscreen .fullscreen-btn i::before,
:-webkit-full-screen .fullscreen-btn i::before {
    content: "\f066"; /* fa-compress */
}

/* =============================================================================
   Products Section - Viewport Unit Sizing
   ============================================================================= */

.products-section {
    flex: 1;
    min-height: 0;
    padding: clamp(6px, 1vh, 30px) clamp(15px, 2.5vw, 70px);
    overflow: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
}

.products-grid {
    max-width: 100%;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

/* =============================================================================
   Menu Board Grid - Viewport Unit Sizing
   ============================================================================= */

.menu-board {
    display: grid;
    grid-template-columns: repeat(var(--menu-columns, 4), 1fr);
    gap: clamp(8px, 1.3vh, 30px);
    padding: 0;
    /* Width is pre-divided by the zoom factor so that after `zoom` is applied
       the board renders back at exactly 100% of its container. This lets
       --menu-scale grow ABOVE 1.0 (bigger text to fill the screen / easier TV
       reading) as well as shrink below it, without ever overflowing sideways. */
    width: calc(100% / var(--menu-scale, 1));
    overflow: hidden;
    align-content: start;
    /* Fit-to-screen scaling set by computePages(): <1 shrinks the whole board to
       fit tall content on one page, 1.0 = no scaling. The board is width-inflated
       above (width = 100% / scale) so that after scaling it renders back at 100%.

       We use `transform: scale()` rather than CSS `zoom` on purpose. With `zoom`,
       each category's overflow:hidden clips in a mixed coordinate space and the
       right-hand columns lose their (right-aligned) prices off the card edge.
       `transform` scales the already-laid-out board as one unit: every card clips
       its own contents in local, un-scaled coordinates, so prices in EVERY column
       stay visible. transform-origin keeps it pinned to the top-left corner. */
    transform: scale(var(--menu-scale, 1));
    transform-origin: top left;
}

.menu-category {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: clamp(6px, 0.8vh, 14px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.category-header {
    background: linear-gradient(135deg, var(--primary-rust), var(--dark-rust));
    padding: clamp(7px, 1.3vh, 28px) clamp(10px, 1.4vw, 38px);
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 18px);
    flex-shrink: 0;
}

.category-header i {
    font-size: clamp(0.95rem, 2.2vh, 3rem);
    color: var(--text-white);
}

.category-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(0.95rem, 2.1vh, 2.8rem);
    font-weight: 600;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: clamp(0.5px, 0.1vw, 3px);
    margin: 0;
}

.category-items {
    padding: clamp(3px, 0.5vh, 12px) 0;
    flex: 1;
}

/* =============================================================================
   Menu Item Row - Viewport Unit Sizing
   ============================================================================= */

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(5px, 1.0vh, 24px) clamp(10px, 1.4vw, 38px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    position: relative;
}

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

.menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.menu-item .item-info {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.6vw, 12px);
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Dotted line between name and price */
.menu-item .item-info::after {
    content: '';
    flex: 1;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.15);
    margin: 0 clamp(5px, 0.8vw, 18px);
    min-width: 15px;
}

.menu-item .item-name {
    font-size: clamp(0.9rem, 1.9vh, 2.7rem);
    color: var(--text-light);
    white-space: nowrap;
    /* Name yields space (truncates with an ellipsis) when a row is too narrow,
       so the price — which is flex-shrink:0 — is never pushed off the right edge
       and clipped by the category's overflow:hidden. Prices always stay visible. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.menu-item .item-pricing {
    display: flex;
    align-items: baseline;
    gap: clamp(3px, 0.4vw, 8px);
    flex-shrink: 0;
    background: var(--bg-card);
    padding-left: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 2px;
}

.menu-item .item-price {
    font-size: clamp(0.95rem, 2.1vh, 2.95rem);
    font-weight: 700;
    color: var(--text-white);
}

.menu-item .item-price.pre-order {
    color: #ffcc00;
    /* Smaller than the price so the name + price + PRE-ORDER fit on one line
       without crowding. Still viewport-responsive so it auto-sizes per display. */
    font-size: clamp(0.55rem, 1.1vh, 1.5rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: clamp(0.5px, 0.08vw, 1.5px);
    line-height: 1.1;
    align-self: center;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.5), 0 0 16px rgba(255, 204, 0, 0.3);
}

.menu-item .item-unit {
    font-size: clamp(0.6rem, 1.25vh, 1.7rem);
    color: var(--text-muted);
}

.menu-item .item-price-original {
    font-size: clamp(0.65rem, 1.45vh, 1.7rem);
    color: var(--text-muted);
    text-decoration: line-through;
}

.menu-item .item-price.sale {
    color: #ffcc00;
    font-size: clamp(1rem, 2.25vh, 3.1rem);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.menu-item .item-savings {
    background: var(--sale-red);
    color: white;
    padding: clamp(1px, 0.15vh, 3px) clamp(3px, 0.4vw, 8px);
    border-radius: 4px;
    font-size: clamp(0.55rem, 1.05vh, 1.15rem);
    font-weight: 700;
    white-space: nowrap;
}

/* =============================================================================
   Flash Sale Highlights
   ============================================================================= */

.menu-item.on-sale {
    background: linear-gradient(90deg, rgba(255, 51, 51, 0.15), rgba(255, 204, 0, 0.1));
    border-left: 3px solid #ffcc00;
    padding-left: clamp(6px, 1vw, 30px);
    animation: flashPulse 2s ease-in-out infinite;
}

.menu-item.on-sale .item-pricing {
    background: transparent;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-right: clamp(4rem, 8vw, 12rem);
    max-width: calc(100% - clamp(4.5rem, 8.5vw, 13rem));
}

.menu-item.on-sale .item-info::after {
    border-bottom-color: rgba(255, 204, 0, 0.3);
}

.menu-item.on-sale .item-name {
    color: var(--text-white);
    font-weight: 600;
}

@keyframes flashPulse {
    0%, 100% {
        background: linear-gradient(90deg, rgba(255, 51, 51, 0.15), rgba(255, 204, 0, 0.1));
    }
    50% {
        background: linear-gradient(90deg, rgba(255, 51, 51, 0.25), rgba(255, 204, 0, 0.2));
    }
}

.flash-badge {
    position: absolute;
    top: 50%;
    right: clamp(8px, 1.2vw, 30px);
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #000;
    padding: clamp(2px, 0.3vh, 8px) clamp(4px, 0.6vw, 16px);
    border-radius: 4px;
    font-size: clamp(0.55rem, 1.05vh, 1.3rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: clamp(2px, 0.3vw, 5px);
    animation: flashBadge 1s ease-in-out infinite;
}

.flash-badge i {
    font-size: clamp(0.55rem, 1.05vh, 1.3rem);
}

@keyframes flashBadge {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.05);
    }
}

/* =============================================================================
   Stock Indicators
   ============================================================================= */

.stock-indicator {
    font-size: clamp(0.5rem, 1.0vh, 1rem);
    padding: clamp(1px, 0.15vh, 3px) clamp(3px, 0.4vw, 8px);
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.stock-indicator.low {
    background: rgba(245, 158, 11, 0.2);
    color: var(--low-stock-yellow);
}

/* Stock Badges (used in card view) */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-badge.sold-out {
    background: rgba(220, 38, 38, 0.2);
    color: var(--sold-out-red);
    border: 1px solid var(--sold-out-red);
}

.stock-badge.low-stock {
    background: rgba(245, 158, 11, 0.2);
    color: var(--low-stock-yellow);
    border: 1px solid var(--low-stock-yellow);
}

.stock-badge.in-stock {
    background: rgba(34, 197, 94, 0.2);
    color: var(--in-stock-green);
    border: 1px solid var(--in-stock-green);
}

/* =============================================================================
   Carousel
   ============================================================================= */

.menu-carousel {
    width: 100%;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.carousel-track {
    display: flex;
    width: 100%;
    will-change: transform;
}

.carousel-page {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
}

.carousel-page .menu-board {
    height: 100%;
}

/* =============================================================================
   Rotation Indicators
   ============================================================================= */

.rotation-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(5px, 0.7vh, 12px);
    padding: clamp(4px, 0.5vh, 12px) 0 clamp(2px, 0.3vh, 5px) 0;
    flex-shrink: 0;
}

.rotation-indicator {
    width: clamp(6px, 0.9vh, 14px);
    height: clamp(6px, 0.9vh, 14px);
    border-radius: 50%;
    background: var(--border-dark);
    border: 2px solid var(--primary-rust);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.rotation-indicator:hover {
    background: var(--light-rust);
    transform: scale(1.2);
}

.rotation-indicator.active {
    background: var(--primary-rust);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(122, 92, 62, 0.5);
}

.rotation-indicator.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--light-rust);
    animation: indicatorProgress 10s linear infinite;
}

@keyframes indicatorProgress {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   Contact Ticker - Viewport Unit Sizing
   ============================================================================= */

.events-ticker {
    background: linear-gradient(90deg, #000000, #0a0a0a, #000000);
    border-top: clamp(2px, 0.3vh, 4px) solid var(--primary-rust);
    display: flex;
    align-items: stretch;
    height: clamp(36px, 5.5vh, 100px);
    overflow: hidden;
    flex-shrink: 0;
}

.ticker-label {
    background: var(--primary-rust);
    color: var(--bg-dark);
    padding: 0 clamp(10px, 1.8vw, 45px);
    display: flex;
    align-items: center;
    gap: clamp(5px, 0.6vw, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    font-size: clamp(0.6rem, 1.2vh, 1.6rem);
}

.ticker-label i {
    font-size: clamp(0.7rem, 1.4vh, 1.8rem);
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
}

.ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-set {
    display: flex;
    align-items: center;
    gap: clamp(15px, 2.5vw, 45px);
    padding-right: clamp(15px, 2.5vw, 45px);
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: clamp(5px, 0.8vw, 14px);
    color: var(--text-light);
    font-size: clamp(0.6rem, 1.2vh, 1.6rem);
    flex-shrink: 0;
    white-space: nowrap;
}

.ticker-item i {
    color: var(--primary-rust);
    font-size: clamp(0.7rem, 1.3vh, 1.7rem);
}

.ticker-contact {
    color: var(--text-white);
    font-weight: 600;
    font-size: clamp(0.65rem, 1.3vh, 1.8rem);
}

/* Flash Sale in Ticker */
.ticker-flash-sale {
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.2), rgba(255, 51, 51, 0.2));
    padding: clamp(4px, 0.5vh, 10px) clamp(8px, 1vw, 18px);
    border-radius: 8px;
    animation: tickerFlashPulse 1.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: clamp(5px, 0.7vw, 12px);
    flex-shrink: 0;
}

@keyframes tickerFlashPulse {
    0%, 100% { background: linear-gradient(90deg, rgba(255, 204, 0, 0.2), rgba(255, 51, 51, 0.2)); }
    50% { background: linear-gradient(90deg, rgba(255, 204, 0, 0.35), rgba(255, 51, 51, 0.35)); }
}

.ticker-flash-sale i {
    color: #ffcc00;
    animation: boltFlash 0.8s ease-in-out infinite;
}

@keyframes boltFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ticker-flash-label {
    color: #ffcc00;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    white-space: nowrap;
}

.ticker-flash-item {
    color: var(--text-white);
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.ticker-flash-price {
    color: #ffcc00;
    font-weight: 700;
    font-size: clamp(0.7rem, 1.4vh, 1.8rem);
    flex-shrink: 0;
    white-space: nowrap;
}

.ticker-flash-savings {
    background: var(--sale-red);
    color: white;
    padding: clamp(2px, 0.25vh, 4px) clamp(4px, 0.5vw, 10px);
    border-radius: 4px;
    font-size: clamp(0.5rem, 1vh, 1rem);
    font-weight: 700;
    flex-shrink: 0;
    white-space: nowrap;
}

.ticker-date {
    background: rgba(122, 92, 62, 0.2);
    padding: clamp(2px, 0.25vh, 6px) clamp(5px, 0.7vw, 15px);
    border-radius: 20px;
    font-size: clamp(0.5rem, 0.9vh, 1.2rem);
    color: var(--primary-rust);
}

.ticker-location {
    color: var(--text-muted);
    font-size: clamp(0.5rem, 0.9vh, 1.2rem);
}

.ticker-separator {
    color: var(--primary-rust);
    font-size: clamp(0.7rem, 1.3vh, 1.6rem);
    flex-shrink: 0;
    padding: 0 3px;
}

.no-events-ticker {
    color: var(--text-muted);
    padding: 0 20px;
    font-style: italic;
}

/* =============================================================================
   Loading & Empty States
   ============================================================================= */

.loading-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--primary-rust);
    font-size: 1.2rem;
    gap: 15px;
}

.loading-indicator i {
    font-size: 2.5rem;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: var(--text-light);
    font-size: 1.2rem;
}

.no-products i {
    font-size: 3rem;
    color: var(--primary-rust);
    margin-bottom: 20px;
    display: block;
}

/* =============================================================================
   Modal (Beef Cuts Guide)
   ============================================================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(145deg, #111111, #0a0a0a);
    border: 2px solid var(--primary-rust);
    border-radius: 20px;
    padding: 40px;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-rust), var(--glow-rust);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(122, 92, 62, 0.1);
    border: 1px solid var(--primary-rust);
    color: var(--primary-rust);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary-rust);
    color: var(--bg-dark);
}

.modal-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary-rust);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 30px;
}

.cuts-grid-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.beef-diagram {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-bottom: 10px;
}

.beef-diagram-img {
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
}

.cuts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.cut-card {
    background: var(--bg-card);
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cut-card:hover {
    border-color: var(--primary-rust);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-rust);
}

.cut-card.active {
    border-color: var(--primary-rust);
    background: rgba(122, 92, 62, 0.15);
    box-shadow: var(--glow-rust);
}

.cut-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    background: rgba(122, 92, 62, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cut-icon i {
    font-size: 1.4rem;
    color: var(--primary-rust);
}

.cut-card h4 {
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.cut-card .cut-location {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.cut-info-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 15px;
    padding: 25px;
}

.cut-info-panel h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary-rust);
    margin-bottom: 15px;
}

.cut-info-panel p {
    color: var(--text-light);
    line-height: 1.6;
}

.cut-details {
    margin-top: 20px;
}

.detail-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-dark);
}

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

.detail-label {
    font-weight: 600;
    color: var(--primary-rust);
    min-width: 150px;
}

.detail-value {
    color: var(--text-light);
}

/* =============================================================================
   Small Screen Responsive (tablets/phones, not TVs)
   ============================================================================= */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .cow-map-btn span,
    .fullscreen-btn span,
    .theme-toggle-btn span {
        display: none;
    }

    .market-location-picker {
        min-width: min(72vw, 300px);
    }

    .market-location-label {
        display: none;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }

    .ticker-label span {
        display: none;
    }

    .cuts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

.products-section::-webkit-scrollbar {
    width: 8px;
}

.products-section::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.products-section::-webkit-scrollbar-thumb {
    background: var(--primary-rust);
    border-radius: 4px;
}

.products-section::-webkit-scrollbar-thumb:hover {
    background: var(--accent-rust);
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-rust);
    border-radius: 4px;
}


/* =============================================================================
   2026-07-02 Facelift — market display readability
   ============================================================================= */
:root { --brand-gold: #C9A227; --brand-cream: #F5F0E1; --brand-copper: #9F6B38; }
body { font-family: 'Geist', 'Lato', sans-serif; background: #050403; }
.watermark-logo { opacity: .075 !important; filter: saturate(.8); }
.markets-header { background: rgba(8,6,4,.92); border-bottom: 1px solid rgba(201,162,39,.35); box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.brand-info h1 { font-family: 'Newsreader', 'Playfair Display', Georgia, serif; letter-spacing: .05em; color: var(--brand-cream); }
.brand-info .tagline { color: rgba(245,240,225,.86); letter-spacing: .22em; }
.header-actions { opacity: .72; transition: opacity .2s ease; }
.header-actions:hover { opacity: 1; }
.header-actions button { border-radius: 12px; backdrop-filter: blur(8px); }
.category-card { border-radius: 14px; border-color: rgba(201,162,39,.24); background: rgba(10,8,6,.88); box-shadow: 0 20px 44px rgba(0,0,0,.22); }
.category-header { background: linear-gradient(135deg, rgba(159,107,56,.95), rgba(107,83,68,.92)); }
.product-name { font-size: clamp(17px, 1.35vw, 23px); color: rgba(245,240,225,.94); }
.product-price { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; font-size: clamp(20px, 1.65vw, 28px); color: #fff; }
.stock-badge, .preorder-badge, .badge-low, .badge-preorder { font-family: 'Geist Mono', monospace; border-radius: 6px; padding: 4px 7px; font-size: clamp(10px, .75vw, 13px); letter-spacing: .06em; }
.events-ticker { min-height: 54px; border-top: 1px solid rgba(201,162,39,.40); background: rgba(5,4,3,.96); }
.ticker-label { background: linear-gradient(135deg, var(--brand-copper), #6B5344); }
.ticker-content { font-size: clamp(13px, .95vw, 18px); }
.rotation-indicators { transform: translateY(-6px); }
@media (min-width: 1000px) {
    .markets-container.display-idle .header-actions { opacity: .18; }
}
@media (max-width: 768px) {
    .header-actions { opacity: 1; flex-wrap: wrap; justify-content: center; }
    .product-row { gap: 10px; }
}
