/* static/style.css */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --border-strong: #adb5bd;
    --accent: #0d6efd;
    --accent-hover: #0b5ed7;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --old-price: #6c757d;
}

[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --border-strong: #444c56;
    --accent: #58a6ff;
    --accent-hover: #388bfd;
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
    --info: #79c0ff;
    --old-price: #8b949e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    transition: background-color 0.15s ease, color 0.15s ease;
    min-height: 100vh;
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.domain {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.phone {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-primary);
    white-space: nowrap;
}

.schedule {
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 12px;
}

.menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 15px;
}

.menu-item {
    color: var(--text-primary);
    text-decoration: none;
    margin: 0 15px;
    white-space: nowrap;
}

.menu-item:hover {
    color: var(--accent);
}

.cart {
    font-size: 28px;
    cursor: pointer;
}

.cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.cart-icon:hover {
    color: var(--accent);
}

.banner {
    height: 300px;
    border: 2px solid var(--border);
    margin: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    font-size: 48px;
    color: var(--text-muted);
    text-align: center;
    border-radius: 8px;
}

.banner-content {
    max-width: 80%;
}

.content-page {
    margin: 40px 0;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.content-page h1 {
    font-size: 28px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.content-page h2 {
    font-size: 22px;
    margin: 32px 0 16px;
    color: var(--text-primary);
}

.content-page p,
.content-page li {
    margin: 12px 0;
    font-size: 16px;
    color: var(--text-secondary);
}

.bottom-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    margin-top: 60px;
}

.bottom-phone {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    margin-right: 20px;
}

.bottom-link,
.bottom-group span {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 15px;
}

.bottom-link:hover {
    color: var(--accent);
}

.bottom-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.theme-toggle {
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.domain {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
}

.domain:hover {
    color: var(--accent);
    transform: scale(1.03);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.product-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-image-wrapper {
    height: 240px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.15s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--success);
}

.add-to-cart-btn {
    margin: 0 16px 16px;
    padding: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.add-to-cart-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .product-image-wrapper {
        height: 200px;
    }
}

.featured-section {
    margin: 40px 0 80px;
}

.section-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-primary);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}

.more-link-wrapper {
    text-align: center;
    margin-top: 40px;
}

.more-link {
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 12px 28px;
    border: 2px solid var(--accent);
    border-radius: 50px;
    transition: all 0.15s ease;
}

.more-link:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.no-products {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}

.product-detail .product-layout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    margin: 20px 0 60px;
}

.product-image-section {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.main-image-wrapper {
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.main-product-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.product-info-section {
    flex: 1.6;
    min-width: 320px;
}

.product-title {
    font-size: 28px;
    margin: 0 0 16px;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-price-block {
    font-size: 32px;
    font-weight: bold;
    color: var(--success);
    margin: 20px 0 28px;
}

.old-price {
    font-size: 22px;
    color: var(--old-price);
    text-decoration: line-through;
    margin-left: 16px;
}

.product-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.product-description,
.product-features {
    margin: 32px 0;
}

.product-description h3,
.product-features h3 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.product-features ul {
    list-style: none;
    padding: 0;
}

.product-features li {
    margin: 12px 0;
    font-size: 16px;
    color: var(--text-secondary);
}

.product-features strong {
    color: var(--text-primary);
}

.product-info-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    color: var(--text-muted);
}

.product-info-footer a {
    color: var(--accent);
}

@media (max-width: 992px) {
    .product-layout {
        flex-direction: column;
    }

    .main-image-wrapper {
        max-height: 500px;
    }
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 40px;
}

.cart-table th,
.cart-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cart-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

.cart-table td {
    vertical-align: middle;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.qty-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.qty {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
}

.remove-btn:hover {
    color: #c82333;
}

.cart-total {
    text-align: right;
    font-size: 24px;
    margin: 20px 0 40px;
}

.cart-total strong {
    font-size: 28px;
    color: var(--success);
}

.cart-buttons {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.15s;
}

.btn-clear {
    background: var(--danger);
    color: white;
    border: none;
}

.btn-clear:hover {
    background: #c82333;
}

.btn-checkout {
    background: var(--success);
    color: white;
    border: none;
}

.btn-checkout:hover {
    background: #157347;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.flash-messages .alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error   { background: #f8d7da; color: #721c24; }
.alert-info    { background: #d1ecf1; color: #0c5460; }
.alert-warning { background: #fff3cd; color: #856404; }

.catalog-grid .product-card {
    padding-bottom: 80px;
}

.catalog-grid .product-card .btn-small {
    padding: 8px 16px;
    font-size: 0.95rem;
}

.catalog-page {
  padding: 30px;
}

.catalog-title {
  font-size: 32px;
  margin-bottom: 30px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.catalog-card {
  text-decoration: none;
  color: inherit;
}

.catalog-card-inner {
  height: 140px;
  border-radius: 12px;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.catalog-card:hover .catalog-card-inner {
  background: #eaeaea;
  transform: translateY(-3px);
}


.catalog-name {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}


/*
.all-products .catalog-card-inner {
  background: #222;
  color: #fff;
}

.all-products:hover .catalog-card-inner {
  background: #000;
}*/

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.back-to-categories {
  text-decoration: none;
  color: #666;
  font-size: 14px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-link {
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
}

.product-image-wrapper {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.product-price {
  display: flex;
  gap: 10px;
  align-items: center;
}

.current-price {
  font-weight: 600;
}

.add-to-cart-btn {
  border: none;
  background: #000;
  color: #fff;
  padding: 14px;
  cursor: pointer;
}

.cart-item-thumb-wrapper {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}

.cart-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-table td:first-child {
    min-width: 300px;
}

.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 960px;
    margin: 0 auto;
    background: var(--bg-secondary, #111);
    color: var(--text-primary, #fff);
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.cookie-text {
    font-size: 0.95rem;
    line-height: 1.4;
}

.cookie-link {
    color: inherit;
    text-decoration: underline;
    margin-left: 6px;
}

.cookie-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.cookie-btn:hover {
    opacity: 0.9;
}

.cookie-banner.hidden {
    display: none;
}

.checkout-page {
    max-width: 1200px;
    margin: 0 auto;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 32px;
}

@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

.checkout-items-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.checkout-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.checkout-item-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.checkout-item-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.item-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}

.checkout-total-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 1.4rem;
}

.total-label {
    font-weight: 600;
}

.total-amount {
    font-weight: 800;
    color: var(--success);
}

.checkout-form-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.checkout-form .form-group {
    margin-bottom: 24px;
}

.checkout-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.checkout-form input,
.checkout-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 1rem;
    transition: border-color 0.15s;
}

.checkout-form input:focus,
.checkout-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
    outline: none;
}

.checkout-form textarea {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
}

.btn-checkout-large {
    padding: 16px 36px;
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-checkout-large:hover {
    background: #157347;
    transform: translateY(-2px);
}

.empty-cart {
    text-align: center;
    padding: 100px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.empty-cart h2 {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.empty-cart p {
    margin-bottom: 32px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.product-card,
.catalog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .catalog-card {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.product-card:hover,
.catalog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    border-color: var(--accent);
}

.product-image-wrapper,
.catalog-card-inner {
    background: var(--bg-secondary);
}

.product-price .current-price {
    color: var(--text-primary);
    font-weight: 700;
}

.product-price .old-price {
    color: var(--text-muted);
}

.add-to-cart-btn {
    background: var(--accent);
    color: white;
    border: none;
    transition: background 0.15s;
}

.add-to-cart-btn:hover {
    background: var(--accent-hover);
}

.buy-now-btn {
    background: var(--success);
    color: white;
    border-radius: 8px;
    border: none;
    margin: 0;
}

.buy-now-btn:hover {
    background: #157347;
}

.buy-now-btn {
    padding: 16px 40px;
    font-size: 1.1rem;
}