* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html{
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    background: #f8f9fa;
    color: #1a1a2e;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ======================================== */
/* Липкий подвал (Sticky Footer)           */
/* ======================================== */


.main {
    flex: 1 0 auto;
}

.footer {
    flex-shrink: 0;
    background: #0A0A0A;
    color: rgba(255, 255, 255, 0.8);
    padding: 20px 0 10px 0;
    margin-top: 40px;
}

.footer a {
    color: #fff;
    opacity: .8;
    font-size: 18px;
    text-decoration: none;
}

.footer a:hover {
    opacity: 1;
}

.footer .container {
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: 14px;
}

.footer .footer-links {
    margin-top: 8px;
}

.footer .footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    margin: 0 10px;
    transition: color 0.2s;
}

.footer .footer-links a:hover {
    color: #fff;
}

.footer-sections{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; 
    justify-content: left;
    gap: 60px;

    padding-bottom: 20px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-section p{
    font-size: 18px;
    text-align: left;
}

.footer-section a{
    border-bottom: 1px solid rgba(255,255,255,.6);
}

/* ======================================== */
/* Шапка (Header)                          */
/* ======================================== */

.header {
    background: linear-gradient(135deg, #000000 0%, #111111 100%);
    color: #fff;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity 0.2s;
}

.logo-img {
    height: 80px;
    width: auto;
    display: block;
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
    padding: 6px 10px;
    border-radius: 6px;
}

.nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-link {
    background: transparent;
    border: 1px solid rgba(255, 193, 7, 0.2);;
    color: #ffc107 !important;
}

.admin-link:hover {
    background: rgba(255, 193, 7, 0.3) !important;
}

/* ======================================== */
/* Поиск в шапке                           */
/* ======================================== */

.search-wrapper {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: background 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.search-icon {
    display: block;
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    transition: filter 0.3s;
}

.search-form:focus-within {
    background: #fff;
    border-color: #fff;
}

.search-form:focus-within .search-icon {
    filter: brightness(0);
}

.search-input {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    outline: none;
    min-width: 120px;
}

.search-form:focus-within .search-input {
    color: #1a1a2e;
}

.search-form:focus-within .search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-form:focus-within .search-btn:hover {
    background: #000;
}
.search-form:focus-within .search-btn:hover .search-icon {
    filter: brightness(0) invert(1);
}
/* ======================================== */
/* Кнопка корзины                          */
/* ======================================== */

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    padding: 12px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    position: relative;
}

.cart-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-icon {
    display: block;
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

.cart-text {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    min-width: 130px;
    justify-content: flex-end;
}

.cart-label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    white-space: nowrap;
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    min-width: 80px;
    justify-content: flex-end;
}

.cart-count {
    color: #fff;
    min-width: 18px;
    text-align: center;
    display: inline-block;
}

.cart-separator {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    white-space: nowrap;
}

.cart-total-price {
    color: #fff;
    min-width: 60px;
    text-align: left;
    display: inline-block;
    white-space: nowrap;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
    border: 2px solid #1a1a2e;
}

/* ======================================== */
/* Корзина-попап                           */
/* ======================================== */

.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.cart-overlay.active {
    display: flex;
}

.cart-popup {
    background: #fff;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.cart-popup-header h2 {
    margin: 0;
    font-size: 28px;
}

.cart-close {
    background: none;
    border: none;
    font-size: 28px;
    border: 1px solid #999;
    padding: 5px 15px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.cart-close:hover {
    color: #333;
    border-color: #333;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 8px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.cart-item-info small {
    color: #888;
    font-size: 12px;
}

.cart-item-price {
    font-size: 14px;
    color: #333;
}

.cart-item-price .old-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 13px;
    margin-right: 6px;
}

.cart-item-price .current-price {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-total {
    font-weight: bold;
    font-size: 16px;
    min-width: 80px;
    text-align: right;
}

/* Скрываем мобильную цену на десктопе */
.cart-item-total-mobile {
    display: none;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    font-weight: bold;
    padding: 8px 0;
    border-top: 2px solid #333;
    margin-top: 8px;
}

.cart-checkout-form {
    margin-top: 20px;
    padding-top: 20px;
}

.cart-checkout-form h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.cart-checkout-form .form-group {
    margin-bottom: 12px;
}

.cart-checkout-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 0px;
    font-size: 14px;
    box-sizing: border-box;
}

.cart-checkout-form input:focus {
    border-color: #153b16;
    outline: none;
}

.cart-checkout-form .btn-block {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 8px;
}

.empty-cart {
    text-align: center;
    padding: 40px 0;
}

.empty-cart p {
    font-size: 18px;
    color: #999;
    margin-bottom: 20px;
}

/* Управление количеством в корзине */
.quantity-control-cart {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.qty-btn-cart {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
}

.qty-btn-cart:hover {
    background: #e5e7eb;
}

.qty-btn-cart:active {
    background: #d1d5db;
}

.quantity-control-cart input[type="number"] {
    width: 45px;
    height: 32px;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
    background: #fff;
}

.quantity-control-cart input[type="number"]::-webkit-outer-spin-button,
.quantity-control-cart input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-control-cart input[type="number"]:focus {
    outline: none;
    background: #f8f9fa;
}

.btn-remove {
    background: #333333;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: #dc2626;
}

/* ======================================== */
/* Flash-сообщения                         */
/* ======================================== */

.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ======================================== */
/* Главная страница                        */
/* ======================================== */

.hero {
    text-align: center;
    padding: 20px 0 20px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.hero p {
    font-size: 18px;
    color: #6b7280;
}

.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* ======================================== */
/* Категории                               */
/* ======================================== */

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.category-card {
    background: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    color: #1a1a2e;
    font-weight: 500;
    font-size: 15px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-count {
    background: rgba(0, 0, 0, 0.08);
    border: .5 solid #ffffff;
    padding: 0 2px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.category-card:hover .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Навигация категорий */
.categories-nav {
    background: #111111;
    border-radius: 0 0 12px 12px;
    padding: 5px 20px 10px 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.categories-nav-parents h3,
.categories-nav-sub h4 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
}

.categories-nav-sub {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.4);
}

.categories-nav .categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.categories-nav .subcategories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.categories-nav .category-card,
.categories-nav .subcategory-card {
    background: #0A0A0A;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.categories-nav .category-card:hover,
.categories-nav .subcategory-card:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
}

.categories-nav .category-card.active,
.categories-nav .subcategory-card.active {
    background: #ffffff;
    color: #000000;
}

.categories-nav .category-card.active .category-count,
.categories-nav .subcategory-card.active .category-count {
    background: rgba(255, 255, 255, .5);
}

/* ======================================== */
/* Сетка товаров                           */
/* ======================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

/* ======================================== */
/* Карточка товара                         */
/* ======================================== */

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-image {
    position: relative;
    padding-top: 75%;
    background: #f3f4f6;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 10px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5; 
}

.discount-badge {
    left: 10px;
    background: #ef4444;
    color: #fff;
}

.featured-badge {
    right: 10px;
    background: #f59e0b;
    color: #fff;
}

.product-name {
    padding: 12px 16px 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    flex: 1;
}

.product-price {
    padding: 0 16px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-price .old-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 14px;
}

.product-price .current-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ======================================== */
/* Выбор варианта в карточке               */
/* ======================================== */

.product-variant-select {
    padding: 0 16px 10px;
}

.variant-select-card {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: #f8f9fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #1a1a2e;
}

.variant-select-card:hover {
    background-color: #f1f3f5;
    border-color: #cbd5e1;
}

.variant-select-card:focus {
    outline: none;
    border-color: #1a1a2e;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.variant-select-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.variant-select-card option {
    padding: 4px 8px;
    font-weight: 400;
}

.variant-select-card option:disabled,
.variant-select-card option.out-of-stock {
    color: #9ca3af;
}

/* ======================================== */
/* Кнопки                                  */
/* ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

.btn-primary {
    background: transparent;
    color: #000;
    border: 1px solid #000;
}

.btn-primary:hover {
    background: #000;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.3);
}

.btn-secondary {
    background: #e5e7eb;
    color: #1a1a2e;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* Кнопка в корзину в карточке */
.product-card .add-to-cart-card {
    margin: 0 16px 16px;
    width: calc(100% - 32px);
    padding: 16px 0;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    background: transparent;
    color: #000000;
    border: 1px solid #000000;
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-card .add-to-cart-card:hover:not(:disabled) {
    background: #000000;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.25);
}

.product-card .add-to-cart-card:active:not(:disabled) {
    transform: translateY(0);
}

.product-card .add-to-cart-card:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.checkbox-group {
    margin: 12px 0 ;
    padding: 12px 0;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 2px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #1a1a2e;
}

.checkbox-group a {
    color: #dc2626;
    text-decoration: underline;
    font-weight: 500;
}

.checkbox-group a:hover {
    color: #991b1b;
}

#submitOrderBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================== */
/* Пагинация                               */
/* ======================================== */

.pagination-wrapper {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.pagination-wrapper nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-wrapper .page-item {
    list-style: none;
}

.pagination-wrapper .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: #fff;
    color: #1a1a2e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.pagination-wrapper .page-link:hover {
    background: #f3f4f6;
}

.pagination-wrapper .active .page-link {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

.pagination-wrapper .disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ======================================== */
/* Страница категории                      */
/* ======================================== */

.category-header {
    padding: 20px 0 30px;
}

.category-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
}

.category-description {
    color: #6b7280;
    font-size: 16px;
    margin-top: 6px;
}

/* ======================================== */
/* Страница товара (детальная)             */
/* ======================================== */

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 20px 0 40px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-main {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.gallery-main img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-thumbnails {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-thumbnails .thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.6;
}

.gallery-thumbnails .thumbnail:hover {
    opacity: 1;
}

.gallery-thumbnails .thumbnail.active {
    border-color: #1a1a2e;
    opacity: 1;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #6b7280;
}

.category-badge a {
    color: #1a1a2e;
    text-decoration: none;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.category-badge a:hover {
    background: #e5e7eb;
}

.views-badge {
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 20px;
}

.product-price-block {
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.product-price-block .current-price {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
}

.product-price-block .old-price {
    font-size: 18px;
    margin-right: 12px;
}

.product-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.product-description p {
    color: #4b5563;
    line-height: 1.7;
}

.product-variants {
    padding: 12px 0;
}

.product-variants h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.variant-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.variant-select:focus {
    outline: none;
    border-color: #1a1a2e;
}

.variant-stock {
    margin-top: 8px;
    font-size: 14px;
}

.in-stock {
    color: #16a34a;
    font-weight: 500;
}

.out-of-stock {
    color: #ef4444;
    font-weight: 500;
}

.add-to-cart-btn {
    padding: 14px 32px;
    font-size: 18px;
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Остаток товара */
.product-stock {
    margin: 8px 0 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    background: #f8f9fa;
}

.product-stock .in-stock {
    color: #16a34a;
}

.product-stock .out-of-stock {
    color: #ef4444;
}

/* Выбор количества */

.product-quantity label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 150px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    background: #f8f9fa;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
}

.qty-btn:hover {
    background: #e5e7eb;
}

.qty-btn:active {
    background: #d1d5db;
}

#quantity-input {
    width: 60px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-left: none;
    border-right: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
}

#quantity-input::-webkit-outer-spin-button,
#quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#quantity-input:focus {
    outline: none;
    border-color: #1a1a2e;
}

/* ======================================== */
/* Админка таблицы                         */
/* ======================================== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background: #fafafa;
}

.admin-table .badge-success {
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.admin-table .badge-danger {
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.admin-table .old-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 12px;
    margin-right: 6px;
}

.admin-table .current-price {
    color: #1a1a2e;
    font-weight: 600;
}

/* ======================================== */
/* Форма админки                           */
/* ======================================== */

.product-form {
    max-width: 700px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #000;
}

.form-group input {
    border: .3px solid rgba(0,0,0,.1);
    border-radius: 4px;
    padding: 15px 20px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.form-control-file {
    padding: 8px 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.existing-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.image-item {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
}

.image-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.image-item .badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: #1a1a2e;
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 12px;
}

.image-item form {
    position: absolute;
    top: 4px;
    right: 4px;
}

.image-item .btn-danger {
    padding: 2px 8px;
    font-size: 14px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Варианты товара в админке */
.variant-row {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.variant-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 0.7fr 0.5fr;
    gap: 12px;
    align-items: end;
}

.skeleton-wrapper {
    display: contents;
}

.skeleton-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: skeletonPulse 1.5s ease-in-out infinite;
    display: flex;
    flex-direction: column;
}

.skeleton-image {
    width: 100%;
    padding-top: 75%;
    background: #e5e7eb;
    flex-shrink: 0;
}

.skeleton-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

@keyframes skeletonPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .variant-fields {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}

.variant-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 4px;
}

.variant-field .form-control {
    padding: 6px 10px;
    font-size: 13px;
}

.variant-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.variant-actions .btn-danger {
    padding: 6px 10px;
    font-size: 14px;
    line-height: 1;
}

/* ======================================== */
/* Страница заказа (админка)               */
/* ======================================== */

.order-detail {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.order-info h2,
.order-items h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.order-info p {
    margin-bottom: 8px;
    color: #4b5563;
}

.order-info strong {
    color: #1a1a2e;
}

/* ======================================== */
/* Статусы заказов                         */
/* ======================================== */

.status-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

.badge-new {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-processing {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ======================================== */
/* Пустые состояния                        */
/* ======================================== */

.empty-message {
    text-align: center;
    padding: 40px 0;
    color: #9ca3af;
    font-size: 16px;
}

input:focus {
    outline: none !important;
}

/* Для мобильных устройств — убираем зум при фокусе */
input, textarea, select {
    font-size: 16px !important;
}

/* ======================================== */
/* Лоадер для изображений                   */
/* ======================================== */

.product-image .image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: auto;
    background: #f3f4f6;
    overflow: hidden;
}

.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.image-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.loader-dots .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1a1a2e;
    opacity: 0.3;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loader-dots .dot:nth-child(1) { animation-delay: 0s; }
.loader-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.product-image .image-wrapper .product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 3;
    transition: opacity 0.5s ease;
    background: #f3f4f6;
}

.product-image .image-wrapper .product-img.loaded {
    opacity: 1;
}

.product-image .image-wrapper .product-img[src*="placeholder"] {
    object-fit: contain;
    padding: 20px;
}

img:not(.product-image img) {
    display: block !important;
}

/* ======================================== */
/* Адаптивность                            */
/* ======================================== */

/* Для планшетов и телефонов */
@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-sections{
        gap: 20px;
    }

    .search-wrapper {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        margin: 8px 0 0;
    }

    .search-header{
        margin: 15px 0;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .order-detail {
        grid-template-columns: 1fr;
    }

    .variant-fields {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* Корзина мобильная */
    .cart-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 0;
    }

    .cart-item-image {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .cart-item-info {
        flex: 1;
        min-width: 120px;
    }

    .cart-item-info h4 {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .cart-item-info small {
        font-size: 11px;
    }

    .cart-item-price {
        font-size: 13px;
    }

    .cart-item-price .current-price {
        font-size: 14px;
    }

    .cart-item-total-mobile {
        display: block;
        font-size: 15px;
        margin-top: 4px;
        color: #1a1a2e;
    }

    .cart-item-total-mobile strong {
        font-size: 16px;
    }

    .cart-item-total {
        display: none;
    }

    .cart-item-actions {
        flex: 1 1 100%;
        justify-content: space-between;
        gap: 8px;
        margin-top: 4px;
    }

    .cart-item-actions .btn-remove{
        margin-right: 15px;
    }

    .quantity-control-cart input[type="number"] {
        width: 40px;
        height: 28px;
        font-size: 13px;
    }

    .qty-btn-cart {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .btn-remove {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .cart-popup {
        max-width: 100%;
        margin: 10px;
        padding: 16px;
        border-radius: 4px;
        max-height: 95vh;
        box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
    }

    .cart-popup-header h2 {
        font-size: 20px;
    }

    .cart-items {
        max-height: 250px;
    }

    .cart-total {
        font-size: 17px;
        padding: 12px 0;
    }

    .cart-total strong {
        font-size: 19px;
    }

    .cart-checkout-form h3 {
        font-size: 16px;
    }

    .cart-checkout-form .btn-block {
        padding: 10px;
        font-size: 14px;
    }
    
}

/* Для маленьких экранов (телефоны) */
@media (max-width: 640px) {
    .logo{
        justify-content: center;
    }
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .product-title {
        font-size: 22px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .loader-dots .dot {
        width: 10px;
        height: 10px;
        gap: 6px;
    }

    .variant-select-card {
        font-size: 12px;
        padding: 6px 10px;
        background-size: 10px;
        background-position: right 8px center;
    }
}

/* Для очень маленьких экранов (до 400px) */
@media (max-width: 400px) {
    .cart-item-image {
        width: 40px;
        height: 40px;
    }

    .cart-item-info h4 {
        font-size: 12px;
    }

    .cart-item-price .current-price {
        font-size: 13px;
    }

    .cart-item-total-mobile {
        font-size: 13px;
    }

    .cart-item-total-mobile strong {
        font-size: 14px;
    }

    .quantity-control-cart input[type="number"] {
        width: 34px;
        height: 24px;
        font-size: 12px;
    }

    .qty-btn-cart {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .btn-remove {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}