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

:root {
    --page-bg: var(--tg-theme-bg-color, #f7f8fa);
    --surface: var(--tg-theme-secondary-bg-color, #ffffff);
    --surface-strong: #eef2f6;
    --text: var(--tg-theme-text-color, #121417);
    --muted: var(--tg-theme-hint-color, #7a828d);
    --line: #e1e5ea;
    --accent: var(--tg-theme-button-color, #2f8dd8);
    --accent-text: var(--tg-theme-button-text-color, #ffffff);
    --danger: #e5484d;
    --radius: 8px;
    --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
    --shadow-soft: 0 2px 10px rgba(16, 24, 40, 0.05);
    --success: #19a463;
}

html {
    min-height: 100%;
    background: var(--page-bg);
}

body {
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 3px solid rgba(47, 141, 216, 0.22);
    outline-offset: 2px;
}

.app,
.admin-app {
    width: 100%;
    min-height: 100vh;
    padding: 14px 12px calc(24px + env(safe-area-inset-bottom));
}

.app-header,
.admin-app header {
    margin: -14px -12px 14px;
    padding: calc(14px + env(safe-area-inset-top)) 12px 12px;
    background: rgba(247, 248, 250, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

h1 {
    margin-bottom: 14px;
    font-size: 23px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

h2 {
    font-size: 21px;
    line-height: 1.22;
    letter-spacing: 0;
}

.store-banner {
    width: 100%;
    margin-bottom: 14px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--page-bg);
}

.store-banner img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 6;
    object-fit: cover;
}

.search-box {
    margin-bottom: 11px;
}

.category-tabs {
    display: flex;
    gap: 11px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.category-tab {
    display: inline-flex;
    flex: 0 0 78px;
    height: 88px;
    padding: 9px 7px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
}

.category-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-icon img {
    width: 100%;
    height: 100%;
    display: block;
    filter: invert(72%) sepia(8%) saturate(352%) hue-rotate(176deg) brightness(88%) contrast(83%);
    opacity: 0.9;
}

.category-tab.active {
    border-color: #d99420;
    color: #f0bd63;
    box-shadow: inset 0 0 0 1px rgba(217, 148, 32, 0.24);
}

.category-tab.active .category-icon img {
    filter: invert(77%) sepia(44%) saturate(568%) hue-rotate(347deg) brightness(101%) contrast(88%);
    opacity: 1;
}

.search-input,
.price-input,
.form-select,
.form-group input,
.form-group textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    box-shadow: var(--shadow-soft);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.search-input:focus,
.price-input:focus,
.form-select:focus,
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 141, 216, 0.14);
}

.filter-section {
    position: relative;
}

.filter-toolbar {
    display: grid;
    grid-template-columns: minmax(142px, 154px) minmax(156px, 172px);
    gap: 10px;
    align-items: start;
}

.filter-toggle,
.btn,
.btn-filter,
.preset-btn,
.category-filter-option,
.filter-chip,
.size-option,
.product-buy-btn {
    min-height: 46px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 650;
    transition: transform 0.12s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.filter-toggle:active,
.btn:active,
.btn-filter:active,
.preset-btn:active,
.category-filter-option:active,
.filter-chip:active,
.size-option:active,
.product-buy-btn:active {
    transform: scale(0.99);
}

.filter-toggle {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 16px;
    box-shadow: var(--shadow-soft);
}

.filter-toggle.active {
    border-color: var(--accent);
}

.filter-icon {
    font-size: 17px;
    line-height: 1;
}

.filter-count {
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: #d99420;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.sort-dropdown {
    position: relative;
    width: 100%;
}

.sort-toggle {
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    font-weight: 650;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.sort-toggle.active,
.sort-toggle:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 141, 216, 0.14);
}

.sort-arrow {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-2px) rotate(45deg);
}

.sort-menu {
    margin-top: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.sort-option {
    width: 100%;
    min-height: 38px;
    padding: 9px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
}

.sort-option.active {
    background: var(--surface-strong);
    color: #f0bd63;
}

.filter-chips {
    display: flex;
    min-height: 0;
    margin-top: 14px;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.clear-all-filters {
    display: inline-flex;
    min-height: 36px;
    margin-top: 10px;
    align-items: center;
    border: none;
    background: transparent;
    color: #f0bd63;
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
}

.filter-chip {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
}

.filter-chip span {
    color: var(--muted);
    font-size: 20px;
    line-height: 0.8;
}

.price-filter {
    position: static;
    max-height: none;
    margin-top: 8px;
    padding: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    pointer-events: auto;
}

.filter-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-title {
    font-size: 17px;
    font-weight: 750;
}

.filter-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.filter-group {
    margin-bottom: 14px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.category-filter-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.category-filter-option,
.size-option {
    padding: 9px 10px;
    background: #f6f9fc;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
}

.category-filter-option.active,
.size-option.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.price-input-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.btn-filter {
    width: 100%;
    padding: 10px 12px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 15px;
    box-shadow: 0 8px 18px rgba(47, 141, 216, 0.22);
}

.btn-clear {
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: none;
}

.price-presets {
    display: flex;
    gap: 8px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.price-presets::-webkit-scrollbar {
    display: none;
}

.preset-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: #f6f9fc;
    border: 1px solid var(--line);
    color: var(--accent);
    font-size: 13px;
    white-space: nowrap;
}

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

.product-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(180deg, rgba(240, 189, 99, 0.12), rgba(240, 189, 99, 0.24) 48%, rgba(240, 189, 99, 0.62)) border-box;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: 0 0 14px rgba(240, 189, 99, 0.08), var(--shadow-soft);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.product-card:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 141, 216, 0.14), var(--shadow-soft);
}

.product-image {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    height: auto;
    object-fit: contain;
    background: var(--surface-strong);
}

.product-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.catalog-photo-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--surface-strong);
}

.catalog-photo-strip {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
}

.catalog-photo-strip::-webkit-scrollbar {
    display: none;
}

.catalog-photo-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    scroll-snap-align: start;
    background: var(--surface-strong);
}

.catalog-photo-counter {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 7px;
    border-radius: 7px;
    background: rgba(18, 20, 23, 0.68);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.catalog-photo-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 7px;
    display: flex;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}

.catalog-photo-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.62);
}

.catalog-photo-dots span.active {
    background: #ffffff;
}

.product-info {
    padding: 10px;
}

.product-title {
    min-height: 36px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.28;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.product-brand {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.product-size-list {
    display: flex;
    gap: 7px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.product-size-pill {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.product-price-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 10px;
}

.product-price {
    margin-top: 0;
    color: var(--accent);
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
}

.product-old-price {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: line-through;
}

.admin-grid .product-price {
    color: var(--success);
}

.loading,
.empty,
.error {
    grid-column: 1 / -1;
    padding: 32px 12px;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}

.error {
    color: var(--danger);
}

.load-more-btn {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(217, 148, 32, 0.36);
    border-radius: var(--radius);
    background: var(--surface);
    color: #f0bd63;
    cursor: pointer;
    font-size: 16px;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.load-more-btn:disabled {
    cursor: default;
    opacity: 0.58;
}

.product-detail-view {
    padding-bottom: 92px;
}

.product-detail {
    width: 100%;
}

.product-carousel {
    position: relative;
    width: calc(100% + 24px);
    margin-left: -12px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    touch-action: pan-y;
    user-select: none;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.28s ease;
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

.detail-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
}

.detail-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(18, 20, 23, 0.56);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

.carousel-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(18, 20, 23, 0.62);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding: 12px 0 2px;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border: none;
    border-radius: 50%;
    background: var(--muted);
    opacity: 0.42;
    cursor: pointer;
}

.carousel-dot.active {
    background: var(--accent);
    opacity: 1;
}

.product-detail-info {
    padding: 18px 0 0;
}

.product-detail-info h2 {
    margin-bottom: 8px;
    font-size: 24px;
    line-height: 1.18;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.product-detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.product-detail-price {
    margin-bottom: 14px;
    color: var(--accent);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 850;
}

.product-detail-price-row .product-detail-price {
    margin-bottom: 0;
}

.product-detail-size {
    margin: -5px 0 14px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
}

.product-detail-old-price {
    color: var(--muted);
    font-size: 17px;
    font-weight: 750;
    text-decoration: line-through;
}

.product-description-card {
    margin-top: 16px;
    padding: 20px;
    border-radius: 16px;
    background: #141414;
}

.product-description-card h3 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 19px;
    line-height: 1.2;
    font-weight: 850;
}

.product-description-card p {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.photo-viewer-open {
    overflow: hidden;
}

.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.96);
}

.photo-viewer-toolbar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: calc(10px + env(safe-area-inset-top)) 10px 10px;
}

.photo-viewer-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    background: rgba(24, 26, 31, 0.86);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.photo-viewer-close {
    font-size: 26px;
    font-weight: 600;
}

.photo-viewer-stage {
    position: relative;
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px 0 calc(18px + env(safe-area-inset-bottom));
}

.photo-viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.16s ease;
    touch-action: none;
    user-select: none;
}

.product-buy-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(247, 248, 250, 0.94);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.product-buy-btn {
    width: 100%;
    min-height: 52px;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 17px;
    box-shadow: 0 10px 24px rgba(47, 141, 216, 0.28);
}

.btn {
    padding: 10px 14px;
    font-size: 15px;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 8px 18px rgba(47, 141, 216, 0.2);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
}

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

.admin-grid .product-card {
    cursor: default;
}

.admin-grid .product-info .btn {
    width: 100%;
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(229, 72, 77, 0.94);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(229, 72, 77, 0.22);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow-y: auto;
    background: rgba(18, 20, 23, 0.52);
}

.modal-content {
    min-height: 100%;
    padding: calc(16px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
    background: var(--page-bg);
}

.modal-content h2 {
    margin-bottom: 18px;
    padding-right: 44px;
}

.close {
    position: absolute;
    top: calc(8px + env(safe-area-inset-top));
    right: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 30px;
    font-weight: 500;
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.form-group input[type="file"] {
    min-height: auto;
    padding: 10px;
    cursor: pointer;
}

.form-group textarea {
    min-height: 112px;
    resize: vertical;
}

.field-hint {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.file-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.broadcast-photo-preview {
    width: 100%;
    max-height: 220px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: contain;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.product-photos-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.product-photo-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.photo-preview-item {
    position: relative;
}

.photo-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(229, 72, 77, 0.95);
    color: #fff;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.broadcast-history {
    margin-top: 14px;
}

.broadcast-history h2 {
    margin-bottom: 12px;
}

.broadcast-history-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    margin-bottom: 10px;
    box-shadow: var(--shadow-soft);
}

.broadcast-history-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.broadcast-history-top strong {
    color: var(--text);
    text-transform: lowercase;
}

.broadcast-message {
    margin-top: 8px;
    white-space: pre-wrap;
}

.broadcast-history-photo {
    width: 100%;
    max-height: 180px;
    margin-top: 10px;
    border-radius: var(--radius);
    object-fit: contain;
    background: var(--page-bg);
}

.broadcast-stats {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.broadcast-stats::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--success);
    vertical-align: 1px;
}

.btn-small {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
}

@media (hover: hover) {
    .product-card {
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .btn:hover,
    .btn-filter:hover,
    .preset-btn:hover,
    .product-buy-btn:hover {
        opacity: 0.86;
    }
}

@media (min-width: 560px) {
    .app,
    .admin-app {
        max-width: 560px;
        margin: 0 auto;
        padding-right: 16px;
        padding-left: 16px;
    }

    .app-header,
    .admin-app header {
        margin-right: -16px;
        margin-left: -16px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .product-carousel {
        width: 100%;
        margin-left: 0;
        border-radius: var(--radius);
    }

    .product-buy-bar {
        left: 50%;
        right: auto;
        width: min(100%, 560px);
        transform: translateX(-50%);
        padding-right: 16px;
        padding-left: 16px;
    }

    .modal-content {
        min-height: auto;
        max-width: 520px;
        margin: 24px auto;
        border-radius: 12px;
        box-shadow: var(--shadow);
    }
}

@media (min-width: 900px) {
    .app,
    .admin-app {
        max-width: 1040px;
        padding-top: 20px;
    }

    .app-header,
    .admin-app header {
        position: static;
        margin: 0 0 20px;
        padding: 0;
        border-bottom: none;
        background: transparent;
        backdrop-filter: none;
    }

    h1 {
        font-size: 28px;
    }

    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }

    .product-info {
        padding: 12px;
    }

    .product-title {
        font-size: 16px;
    }

    .product-price {
        font-size: 18px;
    }

    .product-detail {
        max-width: 720px;
        margin: 0 auto;
    }

    .price-filter {
        width: 100%;
        padding: 14px;
    }

    .filter-close {
        display: none;
    }

    .price-inputs {
        grid-template-columns: 1fr 1fr auto auto;
        align-items: end;
    }

    .btn-filter {
        width: auto;
        min-width: 116px;
    }

    .admin-actions {
        display: flex;
        max-width: 360px;
    }
}

/* Dark storefront theme */
:root {
    --page-bg: #0b0b0d;
    --surface: #15161a;
    --surface-strong: #20232b;
    --text: #f7f7f8;
    --muted: #a3a7b0;
    --line: #2b2e37;
    --accent: #3f4656;
    --accent-text: #ffffff;
    --danger: #ff4d57;
    --success: #2bd66f;
    --shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
    --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.28);
}

html,
body {
    background: var(--page-bg);
}

.app-header,
.admin-app header,
.product-buy-bar {
    background: rgba(11, 11, 13, 0.94);
    border-color: rgba(255, 255, 255, 0.08);
}

h1 {
    color: var(--text);
    font-size: 28px;
    letter-spacing: 0;
}

.search-input,
.price-input,
.form-select,
.form-group input,
.form-group textarea {
    background: #ffffff;
    border-color: transparent;
    color: #151922;
    font-weight: 650;
    box-shadow: none;
}

.search-input::placeholder,
.price-input::placeholder {
    color: #8f96a3;
}

.category-tab {
    background: #111216;
    border-color: #20232b;
    color: #c7cad1;
}

.category-tab.active {
    background: #15161a;
    border-color: #d99420;
    color: #f0bd63;
}

.filter-toggle,
.sort-toggle {
    background: #ffffff;
    border-color: transparent;
    color: #202631;
    text-align: left;
    font-size: 18px;
    font-weight: 800;
    box-shadow: none;
}

.filter-chip,
.category-filter-option,
.size-option {
    background: #ffffff;
    border-color: transparent;
    color: #202631;
    box-shadow: none;
}

.sort-menu {
    background: #15161a;
    border-color: #2b2e37;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
}

.sort-option {
    color: #ffffff;
}

.sort-option.active {
    background: #20232b;
    color: #f0bd63;
}

.filter-chip span {
    color: #8f96a3;
}

.category-filter-option.active,
.size-option.active {
    border-color: #d99420;
    background: #17181d;
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(217, 148, 32, 0.32);
}

.price-filter,
.modal-content,
.broadcast-history-item {
    background: var(--surface);
    border-color: var(--line);
}

.preset-btn,
.btn-secondary {
    background: var(--surface-strong);
    border-color: #363a45;
    color: var(--text);
}

.btn-primary,
.btn-filter,
.product-buy-btn {
    background: #3f4656;
    color: #ffffff;
    box-shadow: none;
}

.btn-clear {
    background: #ffffff;
    color: #111318;
}

.products-grid {
    gap: 18px;
}

.product-card {
    background:
        linear-gradient(#050506, #050506) padding-box,
        linear-gradient(180deg, rgba(240, 189, 99, 0.12), rgba(240, 189, 99, 0.24) 48%, rgba(240, 189, 99, 0.62)) border-box;
    border: 2px solid transparent;
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(240, 189, 99, 0.08), 0 12px 24px rgba(0, 0, 0, 0.42);
}

.product-card:hover {
    box-shadow: 0 0 16px rgba(240, 189, 99, 0.1), 0 16px 30px rgba(0, 0, 0, 0.5);
}

.product-image {
    border-radius: 8px;
    background: #20232b;
}

.catalog-photo-carousel {
    border-radius: 8px;
}

.product-info {
    padding: 12px 12px 14px;
}

.product-brand {
    margin-bottom: 6px;
    color: #a3a7b0;
    font-size: 12px;
    font-weight: 700;
}

.product-title {
    min-height: 40px;
    color: #ffffff;
    font-size: 17px;
    line-height: 1.18;
    font-weight: 850;
}

.product-size-pill {
    border-color: #2b2e37;
    color: #ffffff;
    background: #0c0d10;
}

.product-size-pill.active {
    border-color: #d99420;
    color: #f0bd63;
}

.product-price {
    margin-top: 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
}

.product-old-price {
    color: #777d89;
    font-size: 15px;
}

.admin-grid .product-price {
    color: #ffffff;
}

.loading,
.empty {
    color: #c7cad1;
}

.product-carousel {
    background: #050506;
    border-radius: 8px;
}

.detail-photo {
    background: #050506;
}

.carousel-counter {
    background: rgba(25, 27, 33, 0.78);
    color: #ffffff;
    font-size: 14px;
}

.carousel-dot {
    background: #ffffff;
    opacity: 0.38;
}

.carousel-dot.active {
    background: #ffffff;
    opacity: 1;
}

.product-detail-info h2 {
    color: #ffffff;
    font-size: 27px;
    font-weight: 900;
}

.product-detail-price {
    color: #ffffff;
    font-size: 28px;
    font-weight: 950;
}

.product-detail-old-price {
    color: #7d838d;
}

.product-description-card p {
    color: #d9dbe1;
    font-size: 16px;
}

.product-buy-btn {
    min-height: 58px;
    font-size: 18px;
    font-weight: 850;
}

.delete-btn,
.photo-remove-btn {
    background: rgba(255, 77, 87, 0.96);
}

.close {
    color: #ffffff;
}

.field-hint,
.file-name,
.broadcast-history-top,
.broadcast-stats,
.form-group label {
    color: var(--muted);
}

.broadcast-message {
    color: #ffffff;
}

.telegram-only {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #0b0d10;
    color: #ffffff;
    text-align: center;
}

.telegram-only-panel {
    max-width: 360px;
}

.telegram-only-panel h1 {
    margin-bottom: 12px;
    font-size: 24px;
    line-height: 1.15;
}

.telegram-only-panel p {
    color: #b6bbc4;
    font-size: 16px;
    line-height: 1.45;
}

@media (min-width: 560px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
