@font-face {
    font-family: 'AlibabaSans-Regular';
    src: url('https://assets-persist.lovart.ai/agent-static-assets/AlibabaSans-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'AlibabaSans-Medium';
    src: url('https://assets-persist.lovart.ai/agent-static-assets/AlibabaSans-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'AlibabaSans-Bold';
    src: url('https://assets-persist.lovart.ai/agent-static-assets/Alibaba-PuHuiTi-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'AlibabaSans-Regular', sans-serif;
    color: #333;
    background-color: #f7f8fa;
    line-height: 1.6;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

.container {
    width: 100%;
    margin: 0 auto;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.logo {
    grid-column: 1;
    justify-self: start;
    height: 40px;
}

.nav-menu {
    grid-column: 2;
    justify-self: center;
    display: flex;
    list-style: none;
    gap: 40px; /* Increased gap for better distribution */
    width: 100%;
    justify-content: center;
}

.nav-menu li {
    /* margin-left is removed */
    display: flex;
    align-items: flex-start; /* Align items to top to handle text below */
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-family: 'AlibabaSans-Regular', sans-serif;
    font-size: 14px;
    transition: color 0.3s;
    text-align: center;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-menu-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    font-size: 36px; /* For font icons */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.nav-menu a:hover {
    color: #FF6B00;
}

.header-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
}

.header-buttons a {
    position: relative; /* For positioning the cart count */
    text-decoration: none;
    color: #333;
    margin-left: 20px;
    font-size: 20px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
}

/* Breadcrumb Styles */
.breadcrumb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.breadcrumb-left, .breadcrumb-right {
    flex: 1;
}

.breadcrumb-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.breadcrumb ul {
    display: flex;
    list-style: none;
}

.breadcrumb li {
    font-size: 14px;
    color: #666;
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin: 0 10px;
    color: #ccc;
}

.breadcrumb a {
    text-decoration: none;
    color: #666;
}

.breadcrumb a:hover {
    color: #FF6B00;
}

.breadcrumb li:last-child {
    color: #FF6B00;
}

/* Main Content Styles */
.main-content {
    display: flex;
    padding: 30px;
    background-color: #f7f8fa;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-right: 30px;
    position: fixed;
    top: 85px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar h3 {
    font-family: 'AlibabaSans-Bold', sans-serif;
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.filter-section {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 16px;
    color: #333;
}

.filter-options {
    list-style: none;
}

.filter-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.filter-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #FF6B00;
}

.filter-label {
    font-size: 14px;
    color: #555;
}

.price-range {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.price-input {
    width: 100px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.price-separator {
    margin: 0 10px;
    color: #666;
}

.apply-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #FF6B00;
    color: white;
    border: none;
    border-radius: 4px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 14px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.apply-btn:hover {
    background-color: #E05F00;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.product-search {
    position: relative;
}

.product-search input {
    padding: 8px 15px;
    padding-right: 60px; /* Make space for two icons */
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 500px;
}

.product-search i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.product-search .ri-search-line {
    right: 15px;
}

#clear-search-btn {
    right: 40px; /* Position to the left of the search icon */
    cursor: pointer;
}

/* Product Grid Styles */
.product-section {
    flex: 1;
    margin-left: 310px;
}

.product-controls {
    position: sticky;
    top: 85px; /* Align with sidebar's top offset */
    z-index: 99; /* Below header's z-index of 100 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-count {
    font-size: 14px;
    color: #666;
}

.sort-options {
    display: flex;
    align-items: center;
}

.sort-label {
    font-size: 14px;
    color: #666;
    margin-right: 10px;
    white-space: nowrap;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'AlibabaSans-Regular', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

.product-grid-container {
    /* height and overflow removed to use main scrollbar */
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-image {
    height: 120px;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 13px;
    margin-bottom: 10px;
    color: #333;
    height: 63px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-sku {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.product-specs {
    margin-bottom: 15px;
}

.spec-item {
    display: flex;
    margin-bottom: 5px;
    font-size: 12px;
}

.spec-label {
    color: #666;
    width: 100px;
    flex-shrink: 0;
}

.spec-value {
    color: #333;
    font-family: 'AlibabaSans-Medium', sans-serif;
}

.product-price {
    font-family: 'AlibabaSans-Bold', sans-serif;
    font-size: 16px;
    color: #FF6B00;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .cart-btn,
.product-actions .cart-btn-in-cart {
    min-height: 36px;
}

.cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 6px 5px;
    border-radius: 4px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s;
    background-color: #FF6B00;
    color: white;
    border: none;
    width: 100%;
}

.cart-btn:hover {
    background-color: #E05F00;
}

/* В корзине — зелёный блок с −/+ */
.cart-btn-in-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    background-color: #22c55e;
    color: white;
    border-radius: 4px;
    padding: 6px 8px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 12px;
}
.cart-btn-in-cart .cart-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}
.cart-btn-in-cart .cart-qty-btn:hover {
    background: rgba(255,255,255,0.5);
}
.cart-btn-in-cart .cart-qty-input {
    width: 36px;
    min-width: 36px;
    padding: 2px 4px;
    text-align: center;
    font-weight: bold;
    font-size: 12px;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    border-radius: 4px;
    -moz-appearance: textfield;
}
.cart-btn-in-cart .cart-qty-input::-webkit-outer-spin-button,
.cart-btn-in-cart .cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cart-btn-in-cart .cart-qty-input:focus {
    outline: 2px solid rgba(255,255,255,0.8);
}
.cart-btn-in-cart .cart-btn-label {
    margin-left: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Страница товара — блок в корзине */
.product-actions-top-cart .cart-btn-wrapper {
    display: flex;
}
.product-actions-top-cart .cart-btn-in-cart {
    width: 100%;
    min-height: 53px;
    padding: 12px 16px;
    font-size: 14px;
}
.product-actions-top-cart .cart-btn-in-cart .cart-qty-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
}
.product-actions-top-cart .cart-btn-in-cart .cart-qty-input {
    width: 44px;
    min-width: 44px;
    font-size: 14px;
}

/* Override for product detail page button */
.product-info-main .cart-btn {
    width: auto;
    flex: none;
    padding-left: 30px;
    padding-right: 30px;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    margin: 0 5px;
    border-radius: 4px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-item:hover {
    border-color: #FF6B00;
    color: #FF6B00;
}

.pagination-item.active {
    background-color: #FF6B00;
    border-color: #FF6B00;
    color: white;
}

.pagination-arrow {
    color: #666;
}

.pagination-arrow:hover {
    color: #FF6B00;
}

/* Styles for the cart counter */
.cart-link {
    position: relative;
    display: inline-block;
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #FF6B00;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    min-width: 16px;
    text-align: center;
    display: none; /* Hidden by default, shown by JS */
}

/* Product Detail Page Layout */
#product-details {
    display: block;
    padding: 10px;
    background-color: #fff;
    margin: 30px;
    border-radius: 8px;
}

.product-detail {
    display: flex;
    gap: 30px;
}
.product-detail-image {
    flex: 1.5;
}
.product-detail-info {
    flex: 1;
}

/* More specific styles for Product Detail Page */
.product-detail-info h1 {
    font-size: 24px; /* Was 28px */
    margin-bottom: 15px;
    font-family: 'AlibabaSans-Bold', sans-serif;
}
.product-detail-info .product-sku-single {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}
.product-detail-info .product-price-single {
    font-size: 20px; /* Was 24px */
    color: #FF6B00;
    font-family: 'AlibabaSans-Bold', sans-serif;
    margin-bottom: 15px;
}
.product-detail-info .product-quantity {
    font-size: 15px; /* Was 16px */
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}
.product-detail-info .product-description {
    margin-top: 20px;
    margin-bottom: 30px;
    line-height: 1.5;
    color: #555;
    font-size: 13px; /* Smaller font size */
    position: relative;
    transition: max-height 0.5s ease-in-out;
}

/* Стили для таблиц Bitrix Landing в описаниях товаров */
.product-description .landing-table-container {
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.product-description .landing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #333;
}
.product-description .landing-table th,
.product-description .landing-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}
.product-description .landing-table th {
    background: #f5f5f5;
    font-weight: 600;
}
.product-description .landing-table tr:nth-child(even) td {
    background: #fafafa;
}
.product-description .landing-table .th-tech-icon,
.product-description .landing-table .landing-table-col-dnd,
.product-description .landing-table .landing-table-col-resize,
.product-description .landing-table .landing-table-col-add {
    display: none; /* Скрыть служебные элементы Bitrix */
}

.product-description.collapsed {
    max-height: 200px; 
    overflow: hidden;
}

.product-description .more-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 50px;
    background: linear-gradient(to top, #ffffff 50%, rgba(255, 255, 255, 0));
    text-align: center;
    padding-top: 20px;
    cursor: pointer;
    font-weight: bold;
    color: #FF6B00;
    z-index: 2;
}
.product-detail-info .cart-btn {
    padding: 14px 30px;
    font-size: 16px;
}

/* Cart Page Styles */
#cart-container {
    padding: 30px;
}
#cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
#cart-table th, #cart-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}
#cart-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}
#cart-table img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 15px;
}
.cart-item-name {
    display: flex;
    align-items: center;
}
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cart-page-qty-input {
    width: 40px;
    text-align: center;
    padding: 5px;
    font-size: inherit;
    font-family: inherit;
    border: 1px solid #ddd;
    border-radius: 4px;
    -moz-appearance: textfield;
}
.cart-page-qty-input::-webkit-outer-spin-button,
.cart-page-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.quantity-btn, .remove-btn {
    padding: 5px 10px;
    cursor: pointer;
}

/* Cart Footer and Actions */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#cart-total {
    font-size: 22px;
    font-weight: bold;
}

#cart-actions {
    display: flex;
    gap: 15px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

.modal-content h2 {
    font-family: 'AlibabaSans-Bold', sans-serif;
    font-size: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.checkout-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.checkout-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    padding: 15px;
    background-color: #f7f8fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.checkout-option-btn:hover {
    background-color: #eee;
    border-color: #ccc;
    transform: translateY(-2px);
}

.checkout-option-btn img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

#email-checkout-form h3 {
    margin-bottom: 15px;
    font-size: 16px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'AlibabaSans-Regular', sans-serif;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #FF6B00;
}

.cart-action-btn {
    display: inline-block;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    border: 1px solid transparent;
}

.cart-action-btn {
    background-color: #FF6B00;
    color: white;
    border-color: #FF6B00;
}

.cart-action-btn:hover {
    background-color: #E05F00;
    border-color: #E05F00;
}

.cart-action-btn--secondary {
    background-color: transparent;
    color: #555;
    border-color: #ccc;
}

.cart-action-btn--secondary:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
    color: #333;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.product-quantity {
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

/* Product Gallery Styles */
.product-detail-image {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: flex-start;
    margin-left: 0;
    padding-left: 0;
}

.main-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    height: 600px; /* Fixed height for main image container */
}

.main-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 80px; /* Fixed width for thumbnail column */
    flex-shrink: 0;
    max-height: 600px; /* Match main image height */
    overflow-y: auto;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    margin: 0;
    padding: 0;
}

.product-thumbnails::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background-color: #fff;
    transition: border-color 0.3s;
}

/* Product Actions Top Styles */
.product-actions-top {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.product-actions-top .cart-btn-wrapper {
    width: 200px;
    min-height: 53px;
}
.product-actions-top .cart-btn,
.product-actions-top .back-btn {
    width: 200px;
    height: 53px;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-family: 'AlibabaSans-Medium', sans-serif;
    border-radius: 4px;
    box-sizing: border-box;
    text-decoration: none;
    cursor: pointer;
}

.product-actions-top .back-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    transition: background-color 0.3s;
}

.product-actions-top .back-btn:hover {
    background-color: #e0e0e0;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .sidebar {
        width: 240px;
    }
    
    .product-section {
        margin-left: 270px;
    }
    
    .product-search input {
        width: 100%;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    /* Header */
    header {
        padding: 10px 15px;
    }
    
    .header-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        height: 30px;
        align-self: center;
    }
    
    .nav-menu {
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .nav-menu-icon {
        width: 30px;
        height: 30px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .header-buttons {
        display: flex;
        gap: 20px;
    }
    
    .header-buttons a {
        margin-left: 0;
    }

    /* Main Content */
    .main-content {
        flex-direction: column;
        padding: 15px;
    }
    
    /* Sidebar */
    .sidebar {
        position: static;
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
        max-height: none;
        overflow-y: visible;
        z-index: 1;
    }
    
    /* Product Section */
    .product-section {
        margin-left: 0;
        width: 100%;
    }
    
    .product-controls {
        position: static;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .controls-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .product-search {
        width: 100%;
    }
    
    .product-search input {
        width: 100%;
    }
    
    .sort-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Product Card */
    .product-card {
        display: flex;
        flex-direction: column;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-title {
        height: auto;
        -webkit-line-clamp: 2;
    }
    
    /* Product Detail Page */
    .product-detail {
        flex-direction: column;
        padding: 15px;
    }
    
    .product-detail-image {
        flex-direction: column-reverse;
    }
    
    .product-thumbnails {
        flex-direction: row;
        width: 100%;
        height: auto;
        overflow-x: auto;
        max-height: none;
        padding-bottom: 10px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
    
    .main-image-container {
        height: 300px;
        width: 100%;
    }
    
    /* Product Actions Top */
    .product-actions-top {
        flex-direction: column;
        width: 100%;
    }
    
    .product-actions-top .cart-btn-wrapper {
        width: 100%;
    }
    .product-actions-top .cart-btn,
    .product-actions-top .back-btn {
        width: 100%;
    }
    
    /* Cart */
    #cart-container {
        padding: 15px;
    }
    
    #cart-table thead {
        display: none;
    }
    
    #cart-table tbody, #cart-table tr, #cart-table td {
        display: block;
        width: 100%;
    }
    
    #cart-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }
    
    #cart-table td {
        border: none;
        padding: 5px 0;
        text-align: right;
        position: relative;
        padding-left: 50%;
    }
    
    #cart-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        text-align: left;
        font-weight: bold;
    }
    
    #cart-table td:first-child {
        text-align: center;
        padding-left: 0;
    }
    
    #cart-table td:first-child::before {
        display: none;
    }
    
    .cart-item-name {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cart-item-quantity {
        justify-content: flex-end;
    }
    
    .cart-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    #cart-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cart-action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        gap: 10px;
    }
    
    .nav-menu-icon {
        width: 24px;
        height: 24px;
    }
    
    .header-buttons a {
        font-size: 18px;
    }
}

/* Модалка на телефоне — прокручивается, кнопка всегда доступна */
@media (max-width: 576px) {
    .modal {
        align-items: flex-start;
        padding: 15px 10px 30px;
        overflow-y: auto;
    }
    
    .modal-content {
        padding: 20px 16px 24px;
        max-height: none;
        margin: auto 0;
    }
    
    #email-checkout-form button[type="submit"] {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
}

/* Уведомление вверху экрана (как от браузера) */
.toast-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #2563eb;
    color: #fff;
    padding: 14px 24px;
    font-size: 15px;
    z-index: 99999;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    animation: toast-in 0.3s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}
