:root {
    --bg: #f3f6fa;
    --bg-radial-1: rgba(26, 72, 112, 0.16);
    --bg-radial-2: rgba(13, 145, 130, 0.14);
    --bg-radial-3: rgba(130, 160, 200, 0.18);

    --card: #ffffff;
    --surface: #f7fafc;
    --surface-soft: #f1f6fb;
    --surface-alt: #eef4fa;
    --surface-strong: #e8eef6;

    --ink: #132033;
    --text-strong: #22354f;
    --text-soft: #49617f;
    --muted: #5f7188;

    --primary: #0f7b70;
    --primary-rgb: 15, 123, 112;
    --primary-strong: #0a5f57;
    --primary-soft: #dbf3f0;

    --accent: #e29b43;
    --accent-rgb: 226, 155, 67;

    --line: #d4dfec;
    --line-soft: #e2eaf4;
    --line-strong: #bfd0e3;
    --line-input: #cddbea;
    --line-focus: #6ca7c7;
    --line-button: #ccd9e7;

    --shadow: 0 22px 46px rgba(16, 45, 74, 0.14);
    --shadow-soft: 0 10px 24px rgba(16, 45, 74, 0.1);
    --shadow-price: rgba(var(--primary-rgb), 0.2);
    --shadow-primary: rgba(var(--primary-rgb), 0.32);

    --success-bg: #eaf8ef;
    --success-border: #b7e4c6;
    --success-text: #1d6f46;
    --danger-bg: #ffefef;
    --danger-border: #f0c6c6;
    --danger-text: #9a2c2c;

    --button-danger: #b23a3a;
    --price: #0a6e65;
    --modal-close: #274968;
}

body[data-theme='morado'] {
    --bg: #f3e5f5;
    --bg-radial-1: rgba(156, 39, 176, 0.16);
    --bg-radial-2: rgba(124, 77, 255, 0.14);
    --bg-radial-3: rgba(171, 71, 188, 0.18);

    --ink: #2e003e;
    --text-strong: #3f156d;
    --text-soft: #5e3d88;
    --muted: #6f4b8e;

    --primary: #9c27b0;
    --primary-rgb: 156, 39, 176;
    --primary-strong: #6a1b9a;
    --primary-soft: #f3e5f5;

    --accent: #7c4dff;
    --accent-rgb: 124, 77, 255;

    --line: #dab6e8;
    --line-soft: #ead4f5;
    --line-strong: #b382cf;
    --line-input: #d2b0e8;
    --line-focus: #a05fbf;
    --line-button: #c8a0e7;

    --price: #7b1fa2;
    --button-danger: #8e24aa;
    --modal-close: #512da8;
}

body[data-theme='cafe'] {
    --bg: #efebe9;
    --bg-radial-1: rgba(121, 85, 72, 0.16);
    --bg-radial-2: rgba(93, 64, 55, 0.14);
    --bg-radial-3: rgba(188, 170, 164, 0.18);

    --ink: #3e2723;
    --text-strong: #4e342e;
    --text-soft: #6d4c41;
    --muted: #7b6152;

    --primary: #795548;
    --primary-rgb: 121, 85, 72;
    --primary-strong: #5d4037;
    --primary-soft: #efebe9;

    --accent: #a1887f;
    --accent-rgb: 161, 136, 127;

    --line: #d7ccc8;
    --line-soft: #eee0dc;
    --line-strong: #bcaaa4;
    --line-input: #d7ccc8;
    --line-focus: #8d6e63;
    --line-button: #bcaaa4;

    --price: #5d4037;
    --button-danger: #6d4c41;
    --modal-close: #5d4037;
}

body[data-theme='mar'] {
    --bg: #e1f5fe;
    --bg-radial-1: rgba(3, 169, 244, 0.16);
    --bg-radial-2: rgba(2, 136, 209, 0.14);
    --bg-radial-3: rgba(129, 212, 250, 0.18);

    --ink: #0d47a1;
    --text-strong: #1565c0;
    --text-soft: #1976d2;
    --muted: #4fc3f7;

    --primary: #03a9f4;
    --primary-rgb: 3, 169, 244;
    --primary-strong: #0288d1;
    --primary-soft: #e1f5fe;

    --accent: #81d4fa;
    --accent-rgb: 129, 212, 250;

    --line: #b3e5fc;
    --line-soft: #e1f5fe;
    --line-strong: #81d4fa;
    --line-input: #b3e5fc;
    --line-focus: #039be5;
    --line-button: #81d4fa;

    --price: #0288d1;
    --button-danger: #0277bd;
    --modal-close: #0277bd;
}

body[data-theme='pradera'] {
    --bg: #f1f8e9;
    --bg-radial-1: rgba(139, 195, 74, 0.16);
    --bg-radial-2: rgba(104, 159, 56, 0.14);
    --bg-radial-3: rgba(200, 230, 201, 0.18);

    --ink: #1b5e20;
    --text-strong: #2e7d32;
    --text-soft: #388e3c;
    --muted: #7cb342;

    --primary: #8bc34a;
    --primary-rgb: 139, 195, 74;
    --primary-strong: #689f38;
    --primary-soft: #f1f8e9;

    --accent: #aed581;
    --accent-rgb: 174, 213, 129;

    --line: #dcedc8;
    --line-soft: #f1f8e9;
    --line-strong: #c5e1a5;
    --line-input: #dcedc8;
    --line-focus: #7cb342;
    --line-button: #c5e1a5;

    --price: #689f38;
    --button-danger: #558b2f;
    --modal-close: #558b2f;
}

body[data-theme='atardecer'] {
    --bg: #fff3e0;
    --bg-radial-1: rgba(255, 183, 77, 0.16);
    --bg-radial-2: rgba(255, 167, 38, 0.14);
    --bg-radial-3: rgba(255, 204, 128, 0.18);

    --ink: #e65100;
    --text-strong: #ef6c00;
    --text-soft: #fb8c00;
    --muted: #ffa726;

    --primary: #ffb74d;
    --primary-rgb: 255, 183, 77;
    --primary-strong: #fb8c00;
    --primary-soft: #fff3e0;

    --accent: #ffcc80;
    --accent-rgb: 255, 204, 128;

    --line: #ffe0b2;
    --line-soft: #fff3e0;
    --line-strong: #ffcc80;
    --line-input: #ffe0b2;
    --line-focus: #ffa726;
    --line-button: #ffcc80;

    --price: #fb8c00;
    --button-danger: #e65100;
    --modal-close: #e65100;
}

body[data-theme='fuego'] {
    --bg: #fbe9e7;
    --bg-radial-1: rgba(255, 138, 101, 0.16);
    --bg-radial-2: rgba(255, 112, 67, 0.14);
    --bg-radial-3: rgba(255, 183, 77, 0.18);

    --ink: #bf360c;
    --text-strong: #d84315;
    --text-soft: #e64a19;
    --muted: #ff8a65;

    --primary: #ffab91;
    --primary-rgb: 255, 171, 145;
    --primary-strong: #d84315;
    --primary-soft: #fbe9e7;

    --accent: #ffccbc;
    --accent-rgb: 255, 204, 188;

    --line: #ffccbc;
    --line-soft: #fbe9e7;
    --line-strong: #ffab91;
    --line-input: #ffccbc;
    --line-focus: #ff8a65;
    --line-button: #ffab91;

    --price: #d84315;
    --button-danger: #c62828;
    --modal-close: #c62828;
}

body[data-theme='carbon'] {
    --bg: #eceff1;
    --bg-radial-1: rgba(144, 164, 174, 0.16);
    --bg-radial-2: rgba(120, 144, 156, 0.14);
    --bg-radial-3: rgba(207, 216, 220, 0.18);

    --ink: #263238;
    --text-strong: #37474f;
    --text-soft: #546e7a;
    --muted: #78909c;

    --primary: #b0bec5;
    --primary-rgb: 176, 190, 197;
    --primary-strong: #78909c;
    --primary-soft: #eceff1;

    --accent: #cfd8dc;
    --accent-rgb: 207, 216, 220;

    --line: #cfd8dc;
    --line-soft: #eceff1;
    --line-strong: #b0bec5;
    --line-input: #cfd8dc;
    --line-focus: #78909c;
    --line-button: #b0bec5;

    --price: #546e7a;
    --button-danger: #455a64;
    --modal-close: #455a64;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 48%),
        radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.28), transparent 24%),
        radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.18), transparent 30%),
        radial-gradient(circle at 70% 84%, rgba(255, 255, 255, 0.16), transparent 32%),
        radial-gradient(circle at 35% 75%, rgba(255, 255, 255, 0.08), transparent 28%),
        radial-gradient(circle at 10% 8%, var(--bg-radial-1) 0%, transparent 42%),
        radial-gradient(circle at 90% 2%, var(--bg-radial-2) 0%, transparent 38%),
        radial-gradient(circle at 25% 90%, var(--bg-radial-3) 0%, transparent 42%),
        var(--bg);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

.app-shell {
    position: relative;
    z-index: 1;
    max-width: 980px;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin-right: 60px;
    margin: 0 auto;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    min-width: 0;
}

.app-shell > * {
    min-width: 0;
}

.top-header {
    grid-row: 1;
    position: relative;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 253, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 22px;
    padding: 14px 16px 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
    text-align: center;
    animation: reveal 0.45s ease;
}

.order-toggle-btn {
    position: fixed;
    z-index: 1100;
    width: 57px;
    height: 57px;
    border: 1px solid var(--line-button);
    border-radius: 18px;
    background: linear-gradient(145deg, #ffffff, var(--surface-alt));
    color: var(--text-strong);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(33, 68, 104, 0.16);
}

.order-toggle-icon {
    font-size: 1.65rem;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.order-toggle-count {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.order-toggle-count[hidden] {
    display: none !important;
}

.logo-img {
    width: min(250px, 72vw);
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}

.sub-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.brand-name {
    margin: 0 0 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.22rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-strong);
}

.search-input {
    width: 100%;
    border: 1px solid var(--line-input);
    border-radius: 12px;
    padding: 11px 12px;
    font-size: 0.94rem;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--line-focus);
    box-shadow: 0 0 0 4px var(--shadow-price);
}

.category-nav {
    grid-row: 3;
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
    width: calc(100% - 60px);
    max-width: calc(100% - 60px);
    justify-self: start;
    min-width: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 14px;
    padding: 8px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
}

.category-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    flex: 1 1 0;
    width: 0;
    max-width: 100%;
    padding-right: 48px;
    min-width: 0;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
}
.category-list::-webkit-scrollbar {
    display: none;
}

.search-toggle-btn,
.search-close-btn {
    position: absolute;
    top: -1px;
    right: -1px;
    bottom: -1px;
    width: 44px;
    height: auto;
    min-width: 44px;
    border: 1px solid var(--primary);
    border-radius: 0;
    background: var(--price);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.search-toggle-btn:hover,
.search-close-btn:hover {
    filter: brightness(0.94);
}

.search-toggle-btn svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.search-inline {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: 48px;
}

.search-close-btn {
    padding: 0;
    font-weight: 800;
    line-height: 1;
}

.category-nav.search-mode .category-list,
.category-nav.search-mode .search-toggle-btn {
    display: none;
}

.category-nav:not(.search-mode) .search-inline {
    display: none;
}

.cat-btn {
    border: 1px solid var(--line-button);
    background: #ffffff;
    color: var(--text-strong);
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    flex: 0 0 auto;
    padding: 10px 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cat-btn:hover {
    transform: translateY(-2px);
    border-color: #a9bfd8;
}

.cat-btn.active {
    background: var(--price);
    border-color: transparent;
    color: #fff;
}

.products-scroll {
    grid-row: 2;
    position: relative;
    z-index: 0;
    isolation: isolate;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    min-height: 0;
    touch-action: pan-y;
    padding: 0 16px 24px;
    scroll-behavior: auto;
    animation: reveal 0.65s ease;
}

.category-anchor {
    height: 1px;
}

.category-separator {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 251, 0.93));
    border-bottom: 1px solid var(--line);
    margin-top: 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.category-separator h2 {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 1.08rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-strong);
    padding: 12px 2px;
    flex: 1 1 auto;
}

.publicity-group {
    display: grid;
    gap: 12px;
    padding: 12px 2px;
    position: relative;
    z-index: 0;
}

.publicity-item {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line-soft);
}

.publicity-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.22s ease;
}

.publicity-image:hover {
    transform: scale(1.02);
}

.product-group {
    display: grid;
    gap: 10px;
    padding-bottom: 10px;
    position: relative;
    z-index: 0;
}

.product-item {
    position: relative;
    z-index: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    background: linear-gradient(160deg, #ffffff, var(--surface-soft));
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 12px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.product-item:hover {
    z-index: 1;
    transform: translateY(-1px);
    border-color: #c7d7e9;
    box-shadow: 0 12px 24px rgba(33, 68, 104, 0.1);
}

.product-item.has-image {
    grid-template-columns: 72px 1fr;
    align-items: start;
}

.product-item.is-featured {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
}

.product-item.is-featured.has-image {
    grid-template-columns: 1fr;
}

.product-item.is-featured .product-image {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
}

.product-item.is-featured .product-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 6px;
    align-content: start;
    width: 100%;
    min-width: 0;
}

.product-item.is-featured .product-main-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-width: 0;
    cursor: pointer;
}

.product-item.is-featured .product-price-wrap {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: flex-end;
}

.product-item.is-featured .product-description {
    grid-column: 1 / -1;
}

.product-item.is-featured .product-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.product-item.no-image {
    grid-template-columns: 1fr;
    align-items: start;
}

.product-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line-soft);
    background: var(--card);
    cursor: zoom-in;
}

.product-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 6px;
    align-content: start;
    width: 100%;
    min-width: 0;
}

.product-main-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-width: 0;
    cursor: pointer;
}

.product-price-wrap {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: flex-end;
}

.product-name {
    font-weight: 700;
    min-width: 0;
    justify-self: start;
}

.product-name-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.price-separator {
    height: 1px;
    border-bottom: 2px dotted var(--line-strong);
}

.product-price {
    font-weight: 800;
    color: var(--price);
    justify-self: end;
    width: auto;
    text-align: right;
    white-space: nowrap;
}

.product-qty-badge {
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.product-qty-badge[hidden] {
    display: none !important;
}

.product-description {
    grid-column: 1;
    font-size: 0.82em;
    line-height: 1.35;
    color: var(--muted);
    min-width: 0;
    max-width: 100%;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 18px;
}

.image-modal[hidden] {
    display: none;
}

.image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 21, 35, 0.76);
    backdrop-filter: blur(6px);
}

.image-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 540px);
    background: linear-gradient(165deg, #ffffff, #f3f8fc);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 14px 14px 16px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3);
    display: grid;
    gap: 12px;
}

.image-modal-logo {
    width: min(180px, 48vw);
    max-height: 72px;
    object-fit: contain;
    justify-self: center;
}

.image-modal-img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
}

.image-modal-close {
    justify-self: end;
    border: 1px solid #cfdeed;
    background: #fff;
    color: var(--modal-close);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.image-modal-close:hover {
    background: #f0f6fc;
}

.image-modal-caption {
    margin: 0;
    text-align: center;
    font-weight: 700;
    display: grid;
    gap: 4px;
    white-space: pre-line;
}

.image-modal-product-name {
    color: var(--ink);
}

.image-modal-product-price {
    color: var(--price);
}

body.modal-open {
    overflow: hidden;
}

body.rotation-locked {
    overflow: hidden;
    touch-action: none;
}

.rotation-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 42%),
        rgba(8, 18, 30, 0.92);
    backdrop-filter: blur(10px);
}

.rotation-lock-overlay[hidden] {
    display: none;
}

.rotation-lock-card {
    width: min(92vw, 360px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    padding: 24px 20px;
    text-align: center;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 250, 0.9));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
    display: grid;
    gap: 10px;
}

.rotation-lock-title {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-strong);
}

.rotation-lock-message {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.45;
    color: var(--text-soft);
}

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
}

#orderListModal {
    z-index: 60;
}

#orderQtyModal {
    z-index: 70;
}

.order-modal[hidden] {
    display: none;
}

.order-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 19, 31, 0.74);
    backdrop-filter: blur(7px);
}

.order-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 390px);
    border-radius: 20px;
    border: 1px solid var(--line-soft);
    background: linear-gradient(160deg, #ffffff 0%, var(--surface-soft) 100%);
    padding: 18px;
    display: grid;
    gap: 14px;
    box-shadow: 0 24px 56px rgba(15, 31, 49, 0.24);
    animation: reveal 0.18s ease-out;
}

.order-modal-title {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-strong);
    text-align: center;
}

.order-modal-product-name {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.order-stepper {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 12px;
}

.order-step-btn {
    border: 1px solid var(--line-button);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, var(--surface));
    color: var(--text-strong);
    font-size: 1.5rem;
    font-weight: 800;
    height: 48px;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.order-step-btn:hover {
    transform: translateY(-1px);
    border-color: var(--line-focus);
}

.order-step-btn:active {
    transform: translateY(0);
}

.order-step-value {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--price);
    line-height: 1;
    padding: 4px 0;
}

.order-ok-btn,
.order-back-btn {
    border: 1px solid transparent;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 11px 14px;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.16s ease;
}

.order-ok-btn:hover,
.order-back-btn:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
}

.order-ok-btn:active,
.order-back-btn:active {
    transform: translateY(0);
}

.order-list-dialog {
    width: min(92vw, 470px);
}

.order-list-items {
    max-height: min(52vh, 430px);
    overflow: auto;
    display: grid;
    gap: 9px;
    padding-right: 3px;
}

.order-list-item {
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, var(--surface));
    padding: 11px 12px;
    text-align: left;
    display: grid;
    gap: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.16s ease;
}

.order-list-item:hover {
    border-color: var(--line-focus);
    transform: translateY(-1px);
}

.order-list-item-name {
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.3;
}

.order-list-item-meta {
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.01em;
}

.order-list-empty {
    margin: 0;
    text-align: center;
    color: var(--muted);
    padding: 18px 10px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.order-list-total {
    margin-top: 2px;
    border-top: 1px solid var(--line);
    padding: 10px 2px 2px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.order-list-total-label {
    font-weight: 800;
    color: var(--text-strong);
    letter-spacing: 0.01em;
}

.order-list-total-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--price);
}

.admin-page {
    overflow: auto;
    background:
        radial-gradient(circle at 8% 10%, rgba(42, 88, 140, 0.14) 0%, transparent 42%),
        radial-gradient(circle at 85% 2%, rgba(16, 131, 118, 0.14) 0%, transparent 35%),
        var(--bg);
}

.admin-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 16px 30px;
    display: grid;
    gap: 14px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(145deg, #ffffff, #edf4fb);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
}

.admin-header h1 {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.05em;
    color: var(--text-strong);
}

.admin-link {
    text-decoration: none;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.22);
    transition: transform 0.18s ease, filter 0.2s ease;
    border: transparent;
}

.admin-link:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

.flash {
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 700;
}

.flash-ok {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.flash-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: stretch;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 4px;
}

.admin-tab-btn {
    border: 1px solid var(--line-button);
    border-radius: 12px;
    padding: 8px 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-strong);
    background: linear-gradient(180deg, #ffffff, var(--surface));
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 0;
    text-align: center;
}

.admin-tab-btn:hover {
    transform: translateY(-1px);
    border-color: var(--line-focus);
}

.admin-tab-btn.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.22);
}

.admin-tab-panel {
    display: grid;
    gap: 14px;
}

.admin-tab-panel[hidden] {
    display: none;
}

.admin-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(5px);
}

.admin-card h2 {
    margin: 0 0 10px;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.04em;
    color: var(--text-strong);
}

.admin-form {
    display: grid;
    gap: 8px;
}

.theme-form {
    align-content: start;
}

.theme-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.admin-form label {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-soft);
}

.admin-form input,
.admin-form select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 10px;
    font-family: 'Manrope', sans-serif;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-header-preview {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.admin-form input:focus,
.admin-form select:focus {
    border-color: #7ea5c7;
    box-shadow: 0 0 0 3px rgba(71, 135, 183, 0.16);
}

.admin-btn,
.danger-btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.2s ease;
}

.admin-btn:hover,
.danger-btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.admin-btn {
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-strong));
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.22);
    border-color: transparent;
}

.danger-btn {
    color: #fff;
    background: var(--button-danger);
}

.neutral-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--line-button);
    padding: 9px 12px;
    color: var(--text-strong);
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(180deg, #ffffff, var(--surface));
    transition: transform 0.18s ease, border-color 0.2s ease;
}

.neutral-btn:hover {
    transform: translateY(-1px);
    border-color: var(--line-focus);
}

.admin-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-actions-inline form {
    margin: 0;
}

.admin-form-product-edit {
    max-width: 540px;
}

.admin-product-thumb {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.admin-check-inline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-soft);
    font-weight: 700;
}

.admin-list-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--line);
    display: block;
}

.admin-list-thumb-empty {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px dashed var(--line);
    background: rgba(255, 255, 255, 0.68);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.admin-list-thumb-empty svg {
    width: 24px;
    height: 24px;
    display: block;
}

.admin-star-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    color: #f5c542;
}

.admin-star-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.full-width {
    grid-column: 1 / -1;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th,
td {
    border-bottom: 1px solid #e6edf5;
    text-align: left;
    padding: 10px 8px;
    vertical-align: top;
}

th {
    color: var(--text-soft);
    font-size: 0.78rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: #f3f8fc;
}

td a {
    color: #1a5e95;
}

@media (max-width: 900px) {
    .admin-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .admin-tabs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-shell {
        height: 100dvh;
        min-height: 100dvh;
        padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .top-header,
    .products-scroll {
        border-radius: 16px;
    }

    .products-scroll {
        padding: 0 10px 20px;
    }

    .cat-btn {
        padding: 9px 13px;
        font-size: 0.84rem;
    }

    .order-toggle-btn {
        width: 57px;
        height: 57px;
        border-radius: 16px;
    }

    .product-item {
        padding: 10px;
        font-size: 0.95rem;
    }

    .product-item.has-image {
        grid-template-columns: 60px 1fr;
    }

    .product-main-row,
    .product-info {
        grid-template-columns: minmax(0, 1fr) 92px;
    }

    .product-price {
        width: 92px;
    }

    .product-price-wrap {
        min-width: 92px;
        gap: 6px;
    }

    .product-qty-badge {
        min-width: 22px;
        height: 22px;
        font-size: 0.72rem;
    }

    .product-image {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }

    .image-modal-dialog {
        width: min(94vw, 520px);
        padding: 12px 12px 14px;
    }

    .image-modal-logo {
        width: min(150px, 56vw);
        max-height: 60px;
    }

    .image-modal-img {
        max-height: 68vh;
    }

    .order-modal-dialog {
        width: min(95vw, 390px);
        padding: 14px;
        gap: 12px;
    }

    .order-stepper {
        grid-template-columns: 44px 1fr 44px;
        gap: 10px;
    }

    .order-step-btn {
        height: 44px;
        font-size: 1.35rem;
    }

    .order-step-value {
        font-size: 1.9rem;
    }
}

:focus-visible {
    outline: 2px solid rgba(58, 118, 170, 0.72);
    outline-offset: 2px;
}

