/* Shared mobile layouts. Desktop product photography and campaign styling stay intact. */
@media (max-width: 900px) {
    [hidden] { display: none !important; }
    html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
    body { min-width: 0; }
    input, select, textarea { max-width: 100%; }
    body input:not([type="checkbox"]):not([type="radio"]), body select:not([hidden]), body textarea:not([hidden]) { font-size: 16px; }
    button, a, input, select, textarea { touch-action: manipulation; }
    button:focus-visible, a:focus-visible { outline-offset: 3px; }

    /* Keep every navigation link visible, including the links on information pages. */
    body > header:not(.product-header):not(.checkout-header) { flex-wrap: wrap; gap: 0 12px; padding: 12px 20px 4px; }
    body > header:not(.product-header):not(.checkout-header) > nav { margin-top: 8px; overflow: visible; }
    body > header:not(.product-header):not(.checkout-header) > nav ul { display: flex; flex-wrap: wrap; width: 100%; min-width: 0; gap: 0 18px; padding: 0; }
    body > header:not(.product-header):not(.checkout-header) > nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
    body > header .site-mobile-context-item { flex-basis: 100%; }
    body > header .user-actions a { display: inline-flex; align-items: center; min-height: 44px; }
    .top-bar { padding: 8px 16px; font-size: 10px; line-height: 1.5; letter-spacing: .5px; }
    .top-bar a { display: inline-block; white-space: nowrap; margin: 0 0 0 8px; }

    .category-card, .venum-product-card, .contact-card, .input-group { min-width: 0; }
    .category-card h3, .product-brand-title, .modal-product-right h2 { overflow-wrap: anywhere; }
    .contact-cards-wrapper { flex-direction: column; }
    .contact-card { width: 100%; }
    .form-row { flex-wrap: wrap; }
    .contact-email-link, .social-link, .footer-bottom a, .shipping-return-block a { overflow-wrap: anywhere; }
    .footer-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; }
    .footer-col a, .site-footer-col a, .footer-bottom a, .site-footer-bottom a { display: inline-flex; align-items: center; min-height: 44px; }

    /* Later desktop modal rules must not override the mobile dialog layout. */
    .product-modal { padding: 12px; overflow-y: auto; overscroll-behavior: contain; }
    .product-modal-box { width: 100%; max-width: 640px; max-height: calc(100dvh - 24px); overflow-y: auto; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 52px 20px 24px; }
    .modal-product-left, .modal-product-right { min-width: 0; }
    .modal-image-box { height: auto; aspect-ratio: 1 / 1; max-height: 48svh; }
    .modal-thumbnails { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .thumbnail-btn { height: 70px; }
    .product-modal-close, .modal-close { min-width: 44px; min-height: 44px; }
    .size-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .size-buttons button { min-height: 48px; padding: 8px 4px; }

    .cart-panel { width: min(470px, 100%); height: 100%; max-height: 100dvh; }
    .cart-content { min-height: 0; overscroll-behavior: contain; }
    .cart-summary { flex-shrink: 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    .cart-header { flex-shrink: 0; }
    .cart-close { width: 44px; height: 44px; }
    .cart-item-bottom { flex-wrap: wrap; gap: 10px; }
    .cart-quantity { height: 44px; grid-template-columns: 40px 34px 40px; }
    .cart-quantity button { min-height: 42px; }
    .cart-quantity > span { display: grid; place-items: center; border-left: 1px solid #d6d2cc; border-right: 1px solid #d6d2cc; font-size: 14px; font-weight: 700; }
    .cart-item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
    .cart-item-line-total { grid-column: 2; text-align: right; font-size: 15px; font-weight: 700; }
    .cart-remove { min-height: 44px; }
    .cart-size-editor { display: flex; flex-wrap: wrap; }
    .cart-size-editor select { min-height: 44px; }

    .product-layout { grid-template-columns: minmax(0, 1fr); }
    .product-gallery, .product-info { min-width: 0; }
    .product-title { overflow-wrap: anywhere; }
    .image-thumbnails { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .product-header .back-link { min-height: 44px; display: inline-flex; align-items: center; }

    /* Keep order controls together with each customer on a narrow screen. */
    #orders-table-wrapper table { display: block; min-width: 0; }
    #orders-table-wrapper thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
    #orders-body { display: block; }
    #orders-body > tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; margin: 16px; padding: 18px; border: 1px solid #e2e2e2; border-radius: 8px; background: #fff; }
    #orders-body td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
    #orders-body td::before { content: attr(data-label); display: block; margin-bottom: 7px; color: #666; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
    #orders-body td:nth-child(2), #orders-body td:nth-child(3), #orders-body td:nth-child(6), #orders-body td:nth-child(8), #orders-body td[colspan] { grid-column: 1 / -1; }
    #orders-body .order-customer-details { min-width: 0; max-width: none; }
    #orders-body .order-items { min-width: 0; }
    #orders-body .status-select { width: 100%; min-height: 44px; }
    #orders-body .shipping-controls { min-width: 0; }
    #orders-body .button { width: 100%; min-width: 0; min-height: 44px; }
    .section-header { flex-wrap: wrap; align-items: flex-start; gap: 16px; }
    .section-header .search { width: 100%; min-width: 0; }
    #products-tab .table-wrapper table, #discounts-tab .table-wrapper table { display: block; min-width: 0; }
    #products-tab .table-wrapper thead, #discounts-tab .table-wrapper thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #products-body, #discounts-body { display: block; }
    #products-body > tr, #discounts-body > tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 16px; padding: 18px; border: 1px solid #e2e2e2; border-radius: 8px; }
    #products-body td, #discounts-body td { display: block; padding: 0; min-width: 0; border: 0; overflow-wrap: anywhere; }
    #products-body td::before, #discounts-body td::before { content: attr(data-label); display: block; margin-bottom: 8px; color: #666; font-size: 11px; font-weight: 700; text-transform: uppercase; }
    #products-body .admin-product-summary { min-width: 0; align-items: flex-start; }
    #products-body .admin-product-summary > div { min-width: 0; }
    #products-body .product-price-editor, #products-body .stock-grid { min-width: 0; width: 100%; }
    #products-body .admin-product-actions, #discounts-body .discount-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    #products-body button, #discounts-body button { min-height: 44px; }
    #products-body .product-save { width: 100%; }
    .editor-body, .product-filter-bar, .analytics-filters { min-width: 0; }
    .sales-chart-card { min-width: 0; }
    .sales-chart-container canvas { display: block; max-width: 100%; }
    .product-filter-bar label { min-width: 0; flex-basis: 100%; }
    .product-edit-form { max-height: calc(100dvh - 24px); }
    .product-edit-form header button { min-width: 44px; min-height: 44px; }
    .product-edit-form footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
    .homepage-campaign-inner { display: flex; flex-direction: column; padding: 22px 20px; gap: 14px; }
    .homepage-campaign-heading { display: contents; }
    .homepage-hero-eyebrow { order: 0; margin: 0; font-size: 9px; letter-spacing: .13em; }
    .homepage-campaign-heading h1 { order: 1; font-size: clamp(32px, 9.5vw, 48px); }
    .homepage-campaign-lead { display: none; }
    .homepage-offer-grid { order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; margin-top: 2px; }
    .homepage-offer-label { min-height: 22px; margin-bottom: 8px; align-items: flex-start; gap: 5px; font-size: 8px; line-height: 1.4; letter-spacing: .02em; }
    .homepage-offer-label > span { font-size: 11px; line-height: 1.1; }
    .homepage-offer h2 { font-size: clamp(20px, 5.6vw, 29px); line-height: 1.06; }
    .homepage-offer-price { border-bottom: 0; border-right: 1px solid #ffffff26; padding: 0 14px 0 0; }
    .homepage-offer-wraps { display: block; padding: 0 0 54px; min-height: 0; }
    .homepage-wraps-copy { width: 100%; padding: 0; }
    .homepage-hero-description { margin-top: 7px; font-size: 11px; line-height: 1.45; }
    .homepage-hero-description br { display: none; }
    .homepage-hero-offer-note { margin-top: 7px; font-size: 9px; line-height: 1.4; }
    .homepage-offer-period { margin-top: 7px; font-size: 9px; line-height: 1.45; }
    .homepage-hero-pricing { margin-top: 9px; gap: 5px 8px; }
    .homepage-hero-pricing > strong { font-size: clamp(34px, 9.5vw, 48px); }
    .homepage-hero-pricing del { font-size: 12px; }
    .homepage-hero-pricing > span { font-size: 8px; }
    .homepage-campaign-hero picture { position: absolute; right: -8px; bottom: -6px; width: 100px; height: 66px; }
    .homepage-hero-cta { order: 3; display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 12px 16px; font-size: 10px; }

    .categories-white { padding: 36px 0; }
    .section-container, .venum-products-section { padding-left: 16px; padding-right: 16px; }
    .venum-products-section { padding-top: 36px; padding-bottom: 40px; }
    .venum-products-grid { gap: 26px 12px; }
    .category-slider { gap: 18px 12px; }
    .img-wrapper { height: auto; aspect-ratio: 1 / 1; }
    .quick-add-btn { width: 44px; height: 44px; right: 6px; bottom: 6px; }
    .product-brand-title { font-size: 16px; line-height: 1.2; }
    .product-card-title { overflow-wrap: anywhere; }
    .section-header-row { gap: 12px; }
    .section-header-row h2 { font-size: 25px; }
    .lifestyle-showcase { min-height: 0; }
    .lifestyle-slideshow { height: clamp(460px, 75svh, 640px); }
    .lifestyle-heading h2 { font-size: 32px; }
    .lifestyle-dots button { width: 24px; height: 32px; border: 0; border-radius: 0; position: relative; }
    .lifestyle-dots button::after { content: ''; position: absolute; width: 9px; height: 9px; top: 11px; left: 7px; border: 1px solid #fff; border-radius: 50%; }
    .lifestyle-dots button[aria-current="true"] { background: transparent; }
    .lifestyle-dots button[aria-current="true"]::after { background: #e50914; border-color: #e50914; }
    .contact-section { padding: 48px 16px; }
    .contact-card { padding: 24px 20px; }
    .contact-subtext { margin-bottom: 26px; line-height: 1.6; }
    .contact-cards-wrapper { gap: 20px; }
    .form-row { flex-direction: column; gap: 0; }
    .btn-send { min-height: 48px; }
    .social-link { min-height: 44px; }
    body > footer:not(.checkout-footer):not(.site-footer) { padding: 40px 20px 24px; }
    .footer-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-container > :first-child { grid-column: 1 / -1; }
    .footer-bottom, .site-footer-bottom { align-items: flex-start; gap: 16px; line-height: 1.6; }
    .footer-bottom-links, .site-footer-links { display: flex; flex-wrap: wrap; gap: 0 16px; }

    .cart-header { min-height: 78px; padding: 16px; }
    .cart-content { padding-left: 16px; padding-right: 16px; }
    .cart-summary { padding-left: 16px; padding-right: 16px; }
    .cart-item { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
    .cart-item-image { width: 72px; height: 90px; }
    .cart-item-top { flex-wrap: wrap; gap: 0 8px; }
    .cart-item-name { font-size: 16px; overflow-wrap: anywhere; }
    .cart-remove { margin-top: -6px; }
    .cart-size-editor { font-size: 12px; gap: 5px; }
    .cart-checkout-btn, .cart-checkout-button { min-height: 50px; }
    .upsell-modal { padding: 8px; }
    .upsell-box { max-height: calc(100dvh - 16px); overflow-y: auto; padding: 44px 16px 24px; }
    .upsell-product { min-width: 0; grid-template-columns: 90px minmax(0, 1fr); }
    .upsell-product-info { min-width: 0; padding: 12px; }
    .upsell-header h2 { font-size: 28px; overflow-wrap: anywhere; }
    .upsell-product-info h3 { overflow-wrap: anywhere; }

    .product-page { padding: 20px 16px 40px; }
    .product-layout { gap: 24px; }
    .product-info { padding-top: 0; }
    .product-title { font-size: clamp(30px, 8.7vw, 40px); margin-bottom: 14px; }
    .price-row { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 18px; }
    .short-description { font-size: 14px; line-height: 1.65; margin-bottom: 20px; }
    .divider { margin: 20px 0; }
    .size-options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .size-button { min-height: 48px; padding-left: 4px; padding-right: 4px; font-size: 14px; }
    .quantity-button { width: 44px; height: 48px; flex-shrink: 0; }
    .quantity-row { width: 132px; }
    .add-to-cart-button { min-height: 52px; font-size: 16px; margin-top: 18px; }
    .description-section { padding: 16px 16px 44px; }
    .description-section h2 { font-size: 28px; }
    .description-text { font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
    .site-footer-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .site-footer-container > :first-child { grid-column: 1 / -1; }

    .checkout-page { padding: 24px 16px 40px; }
    .checkout-container { gap: 24px; }
    .checkout-title h1 { font-size: 36px; }
    .checkout-title p { line-height: 1.6; }
    .checkout-card, .order-summary { padding: 20px 16px; }
    .checkout-field input, .checkout-field select { min-height: 48px; }
    .checkout-item-controls { gap: 8px; flex-wrap: wrap; }
    .checkout-item-controls button { width: 44px; height: 44px; }
    .checkout-item-controls .checkout-item-remove { width: auto; min-height: 44px; margin-left: 0; }
    .checkout-order-name { font-size: 14px; line-height: 1.4; }
    .checkout-order-item { gap: 10px 12px; }
    .checkout-order-line-total { margin-top: 0; }
    .checkout-terms { align-items: flex-start; }
    .checkout-submit { min-height: 52px; font-size: 15px; white-space: normal; }
    .shipping-option-content small { max-width: none; }
    .is-confirmation .checkout-page { padding: 28px 20px 40px; }
    .confirmation-content h1 { font-size: clamp(32px, 9.5vw, 46px); }
    .confirmation-layout { gap: 24px; }
    .confirmation-layout h2 { font-size: 18px; }
    .receipt-item strong, .receipt-item b, .receipt-item span, .receipt-totals, .confirmation-delivery address, .confirmation-contact p { font-size: 13px; }
    .confirmation-notice { font-size: 12px; }
    .confirmation-contact p { overflow-wrap: anywhere; }
    .confirmation-actions { flex-direction: column; gap: 10px; }
    .confirmation-actions > * { justify-content: space-between; width: 100%; min-height: 48px; font-size: 11px; }

    .about-hero { min-height: 380px; padding: 56px 20px; }
    .about-hero h1, .about-ending h2 { font-size: clamp(43px, 12vw, 72px); line-height: .98; letter-spacing: -1px; }
    .about-hero-lead { font-size: 15px; line-height: 1.6; margin-top: 24px; }
    .about-story-section, .about-founders, .about-fighters, .about-manifesto, .about-quote-section { padding: 52px 20px; }
    .about-story-container { gap: 18px; }
    .about-story-content h2, .about-founders h2, .about-fighters h2, .about-manifesto h2, .about-ring-content h2 { font-size: clamp(28px, 8vw, 40px); overflow-wrap: anywhere; }
    .about-story-content p, .about-manifesto-intro { font-size: 15px; line-height: 1.8; }
    .about-quote-section blockquote { font-size: clamp(27px, 7.7vw, 36px); }
    .about-founders-grid { margin: 32px 0; }
    .about-founder-card { padding: 20px; }
    .about-founder-photo { height: auto; aspect-ratio: 4 / 5; }
    .about-ring-section { min-height: 360px; padding: 52px 20px; }
    .about-ending { padding: 64px 20px; }
    .about-ending-lines { margin: 36px 0; }
    .about-shop-button { width: 100%; min-height: 50px; padding-left: 16px; padding-right: 16px; }
    .shipping-return-page { padding: 40px 20px 52px; }
    .shipping-return-heading { margin-bottom: 32px; }
    .shipping-return-heading h1 { font-size: clamp(31px, 9.5vw, 42px); overflow-wrap: anywhere; line-height: 1.1; }
    .shipping-return-block h2 { font-size: 23px; overflow-wrap: anywhere; }
    .shipping-return-block, .shipping-return-container { min-width: 0; overflow-wrap: anywhere; }
    .withdrawal-section { padding: 22px 16px; }
    .withdrawal-review { padding: 20px 16px; }
    .withdrawal-review-actions > * { width: 100%; min-height: 48px; }

    .admin-header { padding: 16px; gap: 12px; }
    .admin-header-logo { font-size: 24px; }
    .admin-container { padding: 20px 12px 40px; }
    .admin-navigation { padding: 6px; gap: 4px; }
    .admin-navigation button { min-height: 44px; }
    .admin-header .button { min-height: 44px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 18px 14px; }
    .stat-value { font-size: 25px; overflow-wrap: anywhere; }
    .section-header, .order-filters { padding: 18px 16px; }
    .order-filter { min-height: 44px; }
    #orders-body > tr { margin: 12px; padding: 16px; }
    .admin-container input:not([type="checkbox"]):not([type="radio"]), .admin-container select { min-height: 44px; }
    .form-grid, .image-upload-grid, .stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid > *, .image-upload-grid > *, .editor-body > *, .editor-columns > * { min-width: 0; }
    .admin-container .form-field.full { grid-column: 1 / -1; }
    .editor-body { padding: 18px 16px; }
    .editor-columns { grid-template-columns: minmax(0, 1fr); }
    .editor-images { grid-template-columns: minmax(0, 1fr); }
    .editor-stock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-edit-form header { padding: 18px 16px; align-items: flex-start; }
    .product-edit-form footer { padding: 16px; }
    .product-edit-form footer > div { flex-wrap: wrap; }
    .product-edit-form footer > div > * { min-height: 44px; }
    .analytics-filters { gap: 12px; }
    .analytics-filters label, .analytics-filters > button { flex: 1 1 100%; min-width: 0; }
    .analytics-filters #analytics-custom { flex-wrap: wrap; width: 100%; }
    .dashboard-header, .sales-chart-header { flex-wrap: wrap; gap: 16px; }
    .dashboard-header h2 { font-size: 27px; overflow-wrap: anywhere; }
    .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-panel { min-width: 0; }
    .analytics-panel table { min-width: 440px; }
    .analytics-panel { overflow-x: auto; }
    #analytics-consent button { min-height: 44px; flex: 1; }
}

/* Touch screens should show the primary photo until the product is opened. */
@media (hover: none) and (pointer: coarse) {
    .venum-product-card:hover .has-hover-image .product-card-image-main,
    .venum-product-card:focus-visible .has-hover-image .product-card-image-main { opacity: 1; }
    .venum-product-card:hover .has-hover-image .product-card-image-hover,
    .venum-product-card:focus-visible .has-hover-image .product-card-image-hover { opacity: 0; }
    .venum-product-card:hover .venum-img-container img,
    .main-image-wrapper:hover .main-product-image { transform: none; }
}

@media (max-width: 360px) {
    body > header:not(.product-header):not(.checkout-header) { padding-left: 16px; padding-right: 16px; }
    body > header:not(.product-header):not(.checkout-header) > nav ul { gap: 0 14px; }
    body > header:not(.product-header):not(.checkout-header) > nav a { font-size: 11px; }
    .homepage-campaign-inner { padding-left: 16px; padding-right: 16px; }
    .homepage-hero-cta { width: 100%; justify-content: space-between; gap: 12px; }
    .homepage-offer-label { font-size: 8px; }
    .product-brand-title { font-size: 14px; }
    .cart-item { grid-template-columns: 58px minmax(0, 1fr); gap: 10px; }
    .cart-item-image { width: 58px; height: 76px; }
    .cart-quantity { grid-template-columns: 36px 28px 36px; }
    .checkout-card, .order-summary { padding-left: 12px; padding-right: 12px; }
    #orders-body > tr { margin: 8px; padding: 12px; }
    .form-grid, .image-upload-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
