/* FTR-001A: Basic frontend styles for Coffee Lanch web app */
/* Mobile-first, responsive design from 320px */

:root {
    --primary-color: #6B3A2E;
    --primary-dark: #4F2A21;
    --primary-light: #8C5445;
    --secondary-color: #E85D04;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f9f9f9;
    --card-bg: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header */
.header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    /* Safe-area for iPhone notch / Telegram WebApp status bar */
    padding: calc(env(safe-area-inset-top, 0px) + 6px) 0 6px;
}

.header-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.logo {
    text-align: left;
}

.logo a {
    display: inline-block;
    text-decoration: none;
}

.logo-img {
    height: 64px;
    width: 64px;
    font-size: 64px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.nav {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius);
    transition: all 0.2s;
    position: relative;
}

.nav-link:hover {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.cart-count {
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.cart-header-btn {
    position: relative;
}

/* === Locations dropdown (header) === */
.locations-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
}
.locations-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(107, 58, 46, 0.08);
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.16s ease;
}
.locations-pill-btn:hover {
    background: rgba(107, 58, 46, 0.15);
}
.locations-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: var(--spacing-md);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.locations-dropdown.hidden {
    display: none;
}
.locations-dropdown-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.locations-dropdown-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--spacing-sm);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--bg-color);
    transition: background 0.16s ease;
}
.locations-dropdown-item:hover {
    background: rgba(107, 58, 46, 0.08);
}
.locations-dropdown-item strong {
    font-size: 0.9rem;
    color: var(--text-color);
}
.locations-dropdown-item span {
    font-size: 0.78rem;
    color: var(--text-light);
}
.locations-dropdown-2gis {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    background: transparent;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding-top: var(--spacing-sm);
}

/* === City Pill (header) === */
.city-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 999px;
    background: rgba(46, 125, 50, 0.08);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.16s ease;
    flex-shrink: 0;
}
.city-pill:hover {
    background: rgba(46, 125, 50, 0.15);
}
.city-pill i {
    font-size: 0.95rem;
}
.city-pill-label {
    display: flex;
    flex-direction: column;
}
.city-pill-caption {
    font-size: 0.65rem;
    opacity: 0.7;
    line-height: 1;
}
.city-pill-value {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Mobile: скрыть caption "Город" */
@media (max-width: 639px) {
    .city-pill-caption {
        display: none;
    }
}

/* === City Modal === */
.city-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.city-modal.hidden {
    display: none;
}
.city-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}
.city-modal-content {
    position: relative;
    z-index: 1;
    width: 80%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}
.city-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.04em;
}
.city-option-btn {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 12px 24px;
    background: #fff;
    color: #111;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: background 0.1s ease, transform 0.08s ease;
}
.city-option-btn:hover {
    background: rgba(46, 125, 50, 0.15);
    transform: translateY(-1px);
}
.city-option-btn--active {
    background: var(--primary-color);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Main content */
.main {
    flex: 1;
    padding: var(--spacing-xl) 0;
}

#page-content {
    min-height: 400px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    font-size: 1.125rem;
    color: var(--text-light);
    padding: var(--spacing-xl);
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h3 {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.footer-section p {
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    opacity: 0.9;
}

.footer-section a {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--spacing-md);
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Cart widget (floating) */
.cart-widget {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    z-index: 1000;
}

/* Product catalog styles */
.catalog-page {
    padding: var(--spacing-md) 0;
}

.page-title {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-dark);
}

/* STOREFRONT-CATALOG-TOOLBAR-001: compact toolbar replacing the old two-<select>
   filter block — a scrollable chip row (category) + small button/menu (sort) +
   grid-density toggle, all in one row so it never eats the fold on mobile. */
.catalog-toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.category-chips {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    padding: var(--spacing-xs) 0;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.category-chip.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 0 0 auto;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    height: 36px;
    padding: 0 var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.toolbar-btn svg {
    flex: 0 0 auto;
}

.toolbar-btn.active,
.toolbar-btn[aria-pressed="true"] {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.sort-control {
    position: relative;
}

.sort-toggle-label {
    display: none;
}

.sort-menu {
    position: absolute;
    top: calc(100% + var(--spacing-xs));
    right: 0;
    z-index: 20;
    min-width: 200px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sort-menu-item {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: none;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.sort-menu-item:hover {
    background-color: var(--bg-color);
}

.sort-menu-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.grid-toggle {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.grid-toggle .grid-toggle-btn {
    width: 36px;
    padding: 0;
    border: none;
    border-radius: 0;
}

.category-section {
    margin-bottom: var(--spacing-xl);
}

.category-heading {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
    font-size: 1.15rem;
}

.category-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-light);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.product-card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: cover;
    background-color: #f5f5f5;
}

/* STOREFRONT-MA-104: inline photo carousel inside the product card — a single
   visible image swapped by touch swipe (both directions, wraps around). */
.product-card-media {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;            /* let horizontal swipes reach our handler */
}

.product-card-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 5px;
    pointer-events: none;
}

.card-dot {
    pointer-events: auto;           /* dots are tappable (jump to photo) */
}

.card-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.45);
    transition: width 0.2s, background 0.2s;
}

.card-dot.active {
    width: 14px;
    border-radius: 999px;
    background: #fff;
}

/* STOREFRONT-MA-105/STOREFRONT-DETAIL: fullscreen product detail overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: var(--card-bg);
    z-index: 3000; /* above nav (150) and cart-widget (1000) */
    display: block;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.product-detail-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(280px, 52vh) minmax(0, 1fr);
    background: var(--card-bg);
}

.product-detail-gallery {
    position: relative;
    min-height: 0;
    background: var(--card-bg);
    overflow: hidden;            /* clip the zoomed/panned photo */
}

.lightbox-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: none;          /* JS handles swipe / pinch / pan / zoom */
    overflow: hidden;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--card-bg);
    will-change: transform;
    transform-origin: center center;
}

/* While the photo is zoomed in, hide the carousel chrome to reduce clutter. */
.product-detail-overlay.photo-zoomed .lightbox-nav,
.product-detail-overlay.photo-zoomed .lightbox-dots,
.product-detail-overlay.photo-zoomed .lightbox-counter {
    display: none;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.15s;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    top: max(var(--spacing-md), env(safe-area-inset-top));
    right: max(var(--spacing-md), env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    z-index: 3;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    display: none;
}

.lightbox-prev {
    left: var(--spacing-md);
}

.lightbox-next {
    right: var(--spacing-md);
}

.lightbox-counter {
    position: absolute;
    bottom: calc(var(--spacing-lg) + 18px);
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.lightbox-dots {
    position: absolute;
    bottom: var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.lightbox-dot {
    width: 6px;
    height: 6px;
    /* Override the global 44px touch-target (CSS rule + touch-optimization.js
       inline padding) so the photo dots stay small, as designed. */
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.lightbox-dot.active {
    width: 14px;
    border-radius: 999px;
    background: #fff;
}

.product-detail-info {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
    padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
    background: var(--card-bg);
}

.product-detail-title {
    margin: 0 52px var(--spacing-md) 0;
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
}

.product-detail-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 var(--spacing-lg);
    white-space: pre-line;
}

.variant-section {
    margin-bottom: var(--spacing-md);
}

.variant-label {
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.product-detail-add {
    width: 100%;
    min-height: 52px;
    margin-top: auto;
    font-size: 1rem;
}

/* STOREFRONT-MA: +/- pack quantity stepper in the product detail. */
.pack-stepper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0 var(--spacing-md);
}

.pack-step-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
}

.pack-step-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pack-step-count {
    min-width: 34px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
}

.pack-step-suffix {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* STOREFRONT-MA: опт/розница price-mode toggle in the product detail. */
/* Segmented pill control — deliberately distinct from the solid-purple
   .variant-chip size selector (different shape + tone) so the two don't look
   like the same kind of control. flex-shrink:0 keeps it from collapsing in
   the mobile fullscreen info column. */
.price-mode-toggle {
    display: inline-flex;
    align-self: flex-start;
    flex-shrink: 0;
    gap: 3px;
    padding: 3px;
    background: #eef0f2;
    border-radius: 999px;
    margin: var(--spacing-sm) 0;
}

.price-mode-btn {
    padding: 7px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.price-mode-btn.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

/* STOREFRONT-MA-105: scroll-lock + hide floating cart while lightbox is open
   (STOREFRONT-UX-210: cart-widget z-index:1000 would otherwise overlap controls) */
body.lightbox-open {
    overflow: hidden;
}

body.lightbox-open .cart-widget {
    display: none;
}

.product-info {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-color);
    line-height: 1.25;
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    flex: 1;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

/* ECO-VAR-005: variant size selector (chips) + pack-hint */
.variant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.variant-chip {
    min-height: 44px;
    min-width: 44px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.variant-chip:hover:not(.disabled):not(:disabled) {
    border-color: var(--primary-color);
}

.variant-chip.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.variant-chip:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.variant-chip.disabled,
.variant-chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    text-decoration: line-through;
}

.pack-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

.pack-hint[hidden] {
    display: none;
}

.product-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: auto;
}

.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(46, 125, 50, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cart widget styles */
.cart-widget-container {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
}

.cart-widget-icon {
    font-size: 1.5rem;
}

.cart-widget-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Error and empty states */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: var(--spacing-md);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--border-color);
}

/* Responsive design */
@media (min-width: 640px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer-section {
        flex: 1;
    }

    /* STOREFRONT-CATALOG-TOOLBAR-001: room for the sort button's text label
       once we're past the narrowest phones (icon-only below this). */
    .sort-toggle-label {
        display: inline;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 18px;
    }
    
    .logo h1 {
        font-size: 1.75rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    /* Desktop/tablet: product detail = centered modal (Shopify-style),
       not a mobile fullscreen blown up to the whole viewport. */
    .lightbox-overlay.product-detail-overlay {
        background: rgba(17, 16, 20, 0.62);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--spacing-xl);
    }

    .product-detail-overlay .product-detail-shell {
        width: min(1100px, 100%);
        height: auto;
        max-height: 88vh;
        grid-template-columns: minmax(0, 56%) minmax(340px, 44%);
        grid-template-rows: 1fr;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    }

    .product-detail-gallery {
        min-height: 460px;
    }

    .lightbox-nav {
        display: flex;
    }

    .product-detail-info {
        padding: calc(var(--spacing-xl) * 1.5);
        justify-content: flex-start;
    }

    /* CTA keeps its natural height instead of stretching to fill the column.
       (.add-to-cart-btn sets flex-grow:1, which blew it up to a giant button.) */
    .product-detail-add {
        margin-top: var(--spacing-lg);
        flex: 0 0 auto;
    }

    .product-detail-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 639px) {
    .nav {
        display: none;
    }

    body.nav-open .nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 150;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .logo .tagline {
        display: none;
    }

    .logo-img {
        height: 28px;
        width: 28px;
        font-size: 28px;
        border-radius: 6px;
    }

    .mobile-menu-btn {
        display: block;
    }

    body.nav-open .cart-widget {
        display: none;
    }

    .cart-widget {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }

    /* STOREFRONT-CATALOG-TOOLBAR-001: 1/2-column toggle only makes sense where
       the desktop auto-fill masonry isn't already in play (mobile only). */
    .grid-toggle {
        display: flex;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--spacing-sm);
    }

    .products-grid--cols-1 {
        grid-template-columns: 1fr;
    }

    .products-grid--cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-section .products-grid {
        margin-bottom: 0;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-info {
        padding: var(--spacing-sm);
    }

    .product-image {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .product-actions .btn {
        width: 100%;
        padding-left: var(--spacing-xs, 6px);
        padding-right: var(--spacing-xs, 6px);
    }
}

/* tg-mode: бургер скрыт, нижнее меню достаточно */
body.tg-mode .mobile-menu-btn {
    display: none !important;
}

/* Animation for page transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-transition {
    animation: fadeIn 0.3s ease-in-out;
}

/* ========================================
   TOUCH OPTIMIZATION (STOREFRONT-UX-212)
   Enhanced touch targets and mobile UX
   ======================================== */

/* Enhanced touch targets for all interactive elements */
a,
button,
.btn,
.nav-link,
.bottom-nav-item,
.city-pill,
.cart-header-btn,
input,
select,
textarea {
    /* Already handled by JavaScript, but CSS backup */
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Enhanced focus states for touch devices */
.touch-focused {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Active state for touch interactions */
.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
    transition: transform 0.1s, opacity 0.1s;
}

/* Prevent double-tap zoom on buttons */
button, .btn {
    touch-action: manipulation;
}

/* Enhanced tap highlight for iOS Safari */
a, button, .btn {
    -webkit-tap-highlight-color: rgba(139, 24, 116, 0.2);
}

/* Swipe navigation visual feedback */
body.swipe-active {
    transition: none;
}

body.swipe-left::after,
body.swipe-right::before {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 10px;
    background: rgba(139, 24, 116, 0.3);
    z-index: 9999;
    pointer-events: none;
}

body.swipe-left::after {
    right: 0;
}

body.swipe-right::before {
    left: 0;
}

/* Mobile-optimized form styles */
.mobile-input {
    padding: 14px;
    font-size: 16px; /* Larger font for easier reading */
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 48px; /* Minimum touch target height */
}

.mobile-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 24, 116, 0.2);
}

.mobile-input.valid {
    border-color: #4caf50;
}

.mobile-input.invalid {
    border-color: #f44336;
}

.mobile-focused {
    box-shadow: 0 0 0 3px rgba(139, 24, 116, 0.2) !important;
}

.mobile-form-error {
    color: #f44336;
    font-size: 14px;
    margin-top: 6px;
    padding: 4px 0;
}

.mobile-optimized-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-form-label {
    font-weight: 500;
    color: var(--text-color);
    padding-left: 4px;
}

.mobile-submit-button {
    padding: 16px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-submit-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.mobile-submit-button:active {
    transform: scale(0.98);
}

/* Pull-to-refresh styles */
.pull-to-refresh {
    transition: transform 0.3s ease;
}

.pull-to-refresh-active {
    transform: translateY(60px);
}

.refresh-indicator {
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.pull-to-refresh-active .refresh-indicator {
    opacity: 1;
}

/* ========================================
   TELEGRAM MINIAPP (STOREFRONT-TG-209)
   Activated via body.tg-mode
   ======================================== */

/* Bottom navigation — hidden by default, shown only in Telegram */
.bottom-nav {
    display: none;
}
 @media (max-width: 639px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        padding: 8px 0 env(safe-area-inset-bottom, 8px);
        z-index: 100;
        justify-content: space-around;
        align-items: center;
    }
    .main {
        padding-bottom: 72px;
    }
}

/* Telegram mode: show bottom nav */
body.tg-mode .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 200;
    justify-content: space-around;
    align-items: stretch;
}

/* Telegram mode: hide top nav links */
body.tg-mode .header .nav {
    display: none;
}

/* Telegram mode: hide hamburger button */
body.tg-mode .mobile-menu-btn {
    display: none;
}

/* Telegram mode: hide footer */
body.tg-mode .footer {
    display: none;
}

/* Telegram mode: pad main content above bottom nav */
body.tg-mode .main {
    padding-bottom: 70px;
}

/* Bottom nav items */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 3px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 11px;
    padding: 6px 4px;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 20px;
    line-height: 1;
}

.bottom-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

/* Cart count badge in bottom nav */
.bottom-nav-cart-count {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    text-align: center;
    vertical-align: middle;
    margin-left: 2px;
}

/* STOREFRONT-003-2: Виджет скрыт в Telegram MiniApp режиме */
body.tg-mode .alakris-widget-btn {
    display: none !important;
}

/* Pickup Points Styles */
.pickup-points {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.pickup-point-label {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.pickup-point-label:hover {
    background-color: rgba(139, 24, 116, 0.05);
    border-color: var(--primary-color);
}

.selected-pickup-point {
    background-color: rgba(139, 24, 116, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 24, 116, 0.2);
}

.pickup-point-info {
    flex: 1;
}

.pickup-address {
    color: var(--text-light);
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
    align-self: flex-start;
}

.loading-pickup-points {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    color: var(--text-light);
}

/* Checkout form specific styles */
.checkout-form-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.form-section {
    background-color: var(--card-bg);
    padding: var(--spacing-lg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 24, 116, 0.2);
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: #c62828;
}

.form-error {
    color: #c62828;
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

.form-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    display: block;
}

.delivery-type-selector {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.delivery-type-btn {
    flex: 1;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all 0.2s;
}

.delivery-type-btn:hover {
    background-color: rgba(139, 24, 116, 0.05);
}

.delivery-type-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.delivery-info {
    background-color: rgba(139, 24, 116, 0.05);
    padding: var(--spacing-md);
    border-radius: var(--radius);
    margin: var(--spacing-md) 0;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.payment-method {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
}

.payment-method.selected {
    border-color: var(--primary-color);
    background-color: rgba(139, 24, 116, 0.05);
}

.payment-method-radio {
    margin-top: 3px;
}

.payment-method-content {
    flex: 1;
}

.payment-method-title {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.payment-method-description {
    font-size: 0.875rem;
    color: var(--text-light);
}

.payment-note {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: var(--spacing-md);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: var(--spacing-md) 0;
}

.form-actions {
    margin-top: var(--spacing-xl);
}

.checkout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.checkout-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

@media (min-width: 768px) {
    .checkout-content {
        flex-direction: row;
    }
    
    .checkout-form-section {
        flex: 1;
    }
    
    .checkout-summary {
        width: 350px;
    }
}

/* ============================================================
   STOREFRONT-CART-REDESIGN (2026-06-21): Shopify-style modern cart.
   Previously NO .cart-item/.cart-page rules existed → product
   image rendered at natural (huge) size. Compact 72px thumbnail,
   pill quantity stepper, clean line items + summary card.
   ============================================================ */
.cart-page {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    padding: var(--spacing-md);
    padding-bottom: 40px;
}
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}
.cart-header h1 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-header .btn-secondary {
    font-size: 0.82rem;
    padding: 8px 14px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    white-space: nowrap;
}

/* line items */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cart-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px;
    align-items: start;
}
.cart-item-thumb {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f3f5;
}
.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cart-item-main {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "info remove"
        "controls controls";
    gap: 8px 4px;
    min-width: 0;
}
.cart-item-info { grid-area: info; min-width: 0; }
.cart-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-item-variant {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.72rem;
    color: var(--primary-dark);
    background: #f3eef2;
    padding: 2px 9px;
    border-radius: 999px;
}
.cart-item-unit {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-light);
}
.cart-item-remove {
    grid-area: remove;
    background: transparent;
    border: none;
    color: #b8b2b6;
    font-size: 1.05rem;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
    align-self: start;
}
.cart-item-remove:active { color: #e53935; }
.cart-item-controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    background: #fafafa;
}
.qty-stepper .quantity-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-stepper .quantity-btn:active { background: #f0e6ee; }
.qty-stepper .quantity-input {
    width: 36px;
    height: 34px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    -moz-appearance: textfield;
}
.qty-stepper .quantity-input::-webkit-outer-spin-button,
.qty-stepper .quantity-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item-line-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
}

/* summary card */
.cart-summary { margin-top: var(--spacing-md); }
.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
}

/* Checkout order summary — compact item rows (the photo had no size cap and
   filled the whole column). */
.order-items-preview .preview-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: var(--spacing-md);
}
.preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.preview-item-image {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}
.preview-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.preview-item-details {
    flex: 1;
    min-width: 0;
}
.preview-item-details h5 {
    font-size: 0.85rem;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-item-details p {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
}
.preview-item-total {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}
.summary-card h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
    padding: 6px 0;
}
.summary-row.total-row {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.15rem;
    color: var(--text-color);
}

/* delivery options */
.delivery-section .delivery-options h4,
.delivery-options h4 {
    font-size: 0.9rem;
    margin: 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
}
.delivery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.delivery-option.selected {
    border-color: var(--primary-color);
    background: #faf4f8;
}
.delivery-option-radio input { accent-color: var(--primary-color); }
.delivery-option-content { flex: 1; min-width: 0; }
.delivery-option-title { font-size: 0.88rem; font-weight: 600; display: block; cursor: pointer; }
.delivery-option-description { font-size: 0.74rem; color: var(--text-light); }
.delivery-option-price { font-size: 0.85rem; font-weight: 600; white-space: nowrap; color: var(--text-color); }

/* actions */
.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.summary-actions .btn-block { width: 100%; justify-content: center; }
.summary-actions .btn-primary {
    padding: 14px;
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: 12px;
}
.summary-actions .btn-outline {
    padding: 12px;
    font-size: 0.88rem;
    border-radius: 12px;
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

/* empty state */
.empty-cart-message .empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-light);
}
.empty-cart-message .empty-state i { color: #d8d2d6; margin-bottom: 12px; }
.empty-cart-message .empty-state h3 { margin-bottom: 6px; color: var(--text-color); }
.empty-cart-message .empty-state p { margin-bottom: 16px; }

/* wider screens: 2-column (items | sticky summary), Shopify desktop pattern */
@media (min-width: 768px) {
    .cart-page { max-width: 960px; }
    .cart-content {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 20px;
        align-items: start;
    }
    .cart-summary { margin-top: 0; position: sticky; top: 16px; }
}

/* ============================================================
   Order confirmation page (StorefrontOrderConfirmation)
   Shopify-style: clean cards, constrained thumbnails, clear hierarchy.
   Previously these classes had NO rules → unstyled page + giant images.
   ============================================================ */
.confirmation-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 14px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* success header */
.confirmation-header {
    text-align: center;
    padding: 8px 4px 0;
}
.confirmation-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-color);
}
.confirmation-header h1 i { color: #2e9e5b; }
.confirmation-subtitle {
    margin: 8px 0 0;
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.4;
}

.confirmation-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* generic card */
.confirmation-card,
.details-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: var(--shadow);
}

/* success summary card */
.success-card { text-align: center; }
.success-card .success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #e8f6ee;
    display: flex;
    align-items: center;
    justify-content: center;
}
.success-card .success-icon i { font-size: 1.7rem; color: #2e9e5b; }
.success-card h2 {
    font-size: 1.12rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text-color);
}
.success-card .order-date {
    margin: 0 0 14px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* summary rows */
.order-summary {
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-light);
}
.summary-row > span:last-child { color: var(--text-color); text-align: right; }
.summary-row.total-row {
    border-top: 1px dashed var(--border-color);
    padding-top: 11px;
    margin-top: 3px;
    font-size: 1.05rem;
}
.summary-row.total-row span { color: var(--text-color); }
.status-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
}
.status-badge.status-new { background: #eef2ff; color: #4338ca; }

/* order number block */
.order-number-section {
    text-align: left;
    margin-top: 14px;
    padding: 12px;
    background: #faf7f9;
    border-radius: 12px;
}
.order-number-section > p {
    margin: 0 0 8px;
    font-size: 0.84rem;
    color: var(--text-light);
}
.order-number-display {
    display: flex;
    align-items: center;
    gap: 10px;
}
code.order-number {
    flex: 1;
    font-family: 'SF Mono', ui-monospace, Menlo, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 12px;
    letter-spacing: 0.5px;
}
.btn-icon.btn-outline {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* details sections */
.details-section h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--text-color);
}
.details-section h3 i { color: var(--primary-color); width: 18px; text-align: center; }
.details-content p {
    margin: 0 0 7px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-color);
}
.details-content p strong { color: var(--text-light); font-weight: 600; }
.details-content p:last-child { margin-bottom: 0; }

/* order items list */
.order-items { display: flex; flex-direction: column; gap: 10px; }
.order-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
}
.order-item-image {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f3f5;
    flex: 0 0 auto;
}
.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.order-item-details { min-width: 0; }
.order-item-details h4 {
    margin: 0 0 3px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-item-details .item-sku {
    margin: 0 0 4px;
    font-size: 0.74rem;
    color: var(--text-light);
}
.order-item-details .item-quantity-price {
    font-size: 0.82rem;
    color: var(--text-light);
}
.order-item-total {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    align-self: center;
}

/* order totals */
.order-totals {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.order-totals .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}
.order-totals .total-row.grand-total {
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    margin-top: 2px;
    font-size: 1.1rem;
}
.order-totals .total-row.grand-total span { color: var(--text-color); }

/* actions + note */
.confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.action-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 16px;
    font-size: 0.95rem;
}
.confirmation-note {
    background: #faf7f9;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.confirmation-note p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text-light);
    display: flex;
    gap: 9px;
}
.confirmation-note p i { color: var(--primary-color); margin-top: 2px; flex: 0 0 auto; }
.confirmation-note p strong { color: var(--text-color); font-weight: 600; }

/* wider screens: roomier, two-button row */
@media (min-width: 640px) {
    .action-buttons { flex-direction: row; }
    .order-item { grid-template-columns: 72px 1fr auto; }
    .order-item-image { width: 72px; height: 72px; }
}
