/* shop.css - Стили, специфичные для страницы магазина */
/* Обновлено в соответствии с минималистичным черно-белым стилем */

/* Дополнительные CSS переменные для магазина */
:root {
    --card: var(--white);
    --secondary: var(--gray-dark);
    --primary-rgb: 0, 0, 0;
}

.dark-theme {
    --card: var(--gray-light);
    --secondary: var(--gray-dark);
    --primary-rgb: 255, 255, 255;
}

/* --- Currency Selector --- */
.currency-selector-container {
    position: relative;
}

.currency-selector {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 40px;
    min-width: 100px;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
}

.currency-selector:hover {
    background-color: var(--bg-dark);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.currency-selector:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- Cart Icon --- */
.cart-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary);
    padding: 0;
    flex-shrink: 0;
    font-size: 1.8rem;
    position: relative;
    font-weight: bold;
}

.cart-icon:hover {
    background: var(--bg-dark);
    transform: scale(1.05);
}

.cart-icon::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Стили для основного контента магазина --- */
main.container {
    margin-top: 80px;
    padding-bottom: 3rem;
}

.shop-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.categories-container {
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.categories-container::-webkit-scrollbar {
    height: 6px;
}

.categories-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.categories-scroller {
    display: flex;
    gap: 1rem;
    justify-content: center;
    min-width: max-content;
}

.category-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    touch-action: manipulation;
    color: var(--text);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.category-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.product-section {
    margin-bottom: 3rem;
}

.product-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    text-align: center;
}

.product-card {
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--primary);
}

.product-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-card h3 {
    padding: 1rem 1rem 0.5rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--text);
}

.price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin: 0.5rem 0;
}

.buy-btn {
    padding: 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
    font-family: 'Inter', sans-serif;
    border-radius: 0 0 8px 8px;
}

.buy-btn:hover {
    background: var(--gray-dark);
}

.buy-btn.added {
    background: var(--gray) !important;
    transform: scale(0.95);
}

/* --- Модальное окно корзины --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--text-light);
}

.modal-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-align: center;
}

.cart-items {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 1.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
    border: 1px solid var(--border);
}

.cart-item-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.cart-item-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 0.5rem;
}

.cart-item-controls button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.cart-item-controls button:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.cart-item-controls span {
    min-width: 20px;
    text-align: center;
    font-weight: 500;
    color: var(--text);
}

.cart-total {
    text-align: right;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.cart-total p {
    margin: 0;
}

#checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

#checkout-btn:hover {
    background: var(--gray-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

/* --- Стили для формы оформления заказа --- */
.checkout-section {
    margin-top: 80px;
    padding: 2rem 0;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.checkout-container {
    background: var(--bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.order-summary {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 6px;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.order-summary h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
}

#order-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    color: var(--text);
}

/* --- Стили для модального окна фото --- */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.photo-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.photo-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1004;
}

.photo-modal-close:hover,
.photo-modal-close:focus {
    color: #bbb;
}

.photo-modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    transform: translateY(-50%);
    z-index: 1004;
}

.photo-modal-nav button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.photo-modal-nav button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Footer магазина --- */
footer {
    background: var(--bg-dark);
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* --- Адаптация для планшетов и мобильных --- */
@media (max-width: 768px) {
    .header {
        height: 56px;
        padding: 0.5rem 0;
    }
    
    .header-content {
        padding: 0 1.25rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .header-actions {
        gap: 0.75rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
    }
    
    .currency-selector {
        font-size: 0.85rem;
        padding: 0.4rem 1.75rem 0.4rem 0.75rem;
        min-width: 90px;
        height: 36px;
    }
    
    .cart-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    main.container {
        margin-top: 70px;
    }
    
    .categories-container {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-image {
        height: 280px;
    }
    
    .mobile-menu ul {
        padding: 0 1.25rem;
    }
}

@media (max-width: 480px) {
    .header {
        height: 52px;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .theme-toggle,
    .cart-icon {
        width: 32px;
        height: 32px;
    }
    
    .currency-selector {
        font-size: 0.8rem;
        padding: 0.35rem 1.5rem 0.35rem 0.65rem;
        min-width: 80px;
        height: 32px;
    }
    
    main.container {
        margin-top: 65px;
    }
    
    .mobile-menu ul {
        padding: 0 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* --- Стили для кнопок с количеством на карточках товаров --- */
.buy-btn.has-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 0.5rem;
    background: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.buy-btn.has-quantity:hover {
    background: var(--bg);
    transform: none;
}

.btn-quantity {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.btn-quantity:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-quantity-value {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

/* Убираем стандартные стили кнопки при наличии количества */
.buy-btn.has-quantity {
    background: none;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--border);
    border-top: none;
}

.buy-btn.has-quantity .btn-quantity {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .buy-btn.has-quantity {
        gap: 0.5rem;
        padding: 0.75rem 0.25rem;
    }
    
    .btn-quantity {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }
    
    .btn-quantity-value {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .buy-btn.has-quantity {
        gap: 0.4rem;
        padding: 0.6rem 0.2rem;
    }
    
    .btn-quantity {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }
}