/* Магазин — стили */

.shop-hero {
    min-height: 45vh;
    padding: 140px 5% 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.shop-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(139, 0, 0, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(201, 162, 39, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 0, 0, 0.08) 0%, transparent 60%),
        var(--vinyl-black);
}

/* Signature as central decoration - like vinyl on main page */
.signature-decoration {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 100%;
    background-image: url('../images/signage-alexey-vishnya.png');
    background-size: 100% auto;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.08;
    filter: invert(1) brightness(1.1);
}

/* Content above background */
.shop-hero .section-label,
.shop-hero .section-title,
.shop-hero .shop-intro {
    position: relative;
    z-index: 2;
}

.shop-intro {
    max-width: 600px;
    margin: 0 auto;
    color: var(--cream);
    opacity: 0.8;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Контент магазина */
.shop-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Боковая панель */
.shop-filters {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.shop-filters h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    color: var(--gold);
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(245, 240, 230, 0.2);
    color: var(--cream);
    padding: 12px 20px;
    font-family: 'PT Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.filter-btn:hover {
    border-color: var(--cherry-light);
    color: var(--cherry-light);
}

.filter-btn.active {
    background: var(--cherry);
    border-color: var(--cherry);
    color: var(--cream);
}

/* Корзина в боковой панели */
.cart-summary {
    background: rgba(245, 240, 230, 0.03);
    border: 1px solid rgba(245, 240, 230, 0.1);
    padding: 20px;
    transition: all 0.3s ease;
}

.cart-summary.highlight {
    border-color: var(--cherry-light);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.3);
}

.cart-empty {
    color: rgba(245, 240, 230, 0.5);
    font-size: 0.9rem;
    font-style: italic;
}

.cart-items {
    margin: 15px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(245, 240, 230, 0.1);
    font-size: 0.85rem;
}

.cart-item-title {
    color: var(--cream);
    flex: 1;
    margin-right: 10px;
}

.cart-item-qty {
    color: var(--cherry-light);
    font-family: 'PT Mono', monospace;
    font-size: 0.8rem;
}

.cart-item-price {
    color: var(--gold);
    white-space: nowrap;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--cherry-light);
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    font-size: 1.2rem;
    line-height: 1;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(245, 240, 230, 0.2);
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
}

.cart-total-label {
    color: var(--cream);
}

.cart-total-value {
    color: var(--gold);
}

.btn-checkout {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    background: var(--cherry);
    border: none;
    color: var(--cream);
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: var(--cherry-light);
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--cream);
    opacity: 0.6;
    padding: 60px 0;
}

/* Карточка товара */
.product-card {
    background: rgba(245, 240, 230, 0.03);
    border: 1px solid rgba(245, 240, 230, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.product-card:hover {
    border-color: var(--cherry-light);
    transform: translateY(-5px);
}

.product-image {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.2), rgba(13, 13, 13, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    font-size: 4rem;
    opacity: 0.3;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-family: 'PT Mono', monospace;
    font-size: 0.75rem;
    color: var(--cherry-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.product-title {
    font-family: 'PT Serif', serif;
    font-size: 1.3rem;
    color: var(--cream);
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-price {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    color: var(--gold);
}

.product-out-of-stock {
    color: rgba(245, 240, 230, 0.4);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: var(--smoke);
    border: 1px solid rgba(245, 240, 230, 0.1);
    max-width: 700px;
    width: 100%;
    position: relative;
    margin: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--cream);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    z-index: 10;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 40px;
}

.modal-body h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    color: var(--cream);
    margin-bottom: 30px;
    letter-spacing: 0.05em;
}

/* Детали товара в модалке */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Галерея изображений товара */
.product-detail-gallery {
    position: sticky;
    top: 0;
}

.gallery-main {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.2), rgba(13, 13, 13, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: opacity 0.3s;
}

.gallery-main img:hover {
    opacity: 0.9;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--cream);
    width: 40px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0;
}

.gallery-main:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background: var(--cherry);
}

.gallery-prev {
    left: 0;
}

.gallery-next {
    right: 0;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.gallery-thumb {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.6;
}

.gallery-thumb:hover {
    opacity: 0.9;
}

.gallery-thumb.active {
    border-color: var(--cherry-light);
    opacity: 1;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-image {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.2), rgba(13, 13, 13, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    cursor: zoom-in;
    transition: opacity 0.3s;
}

.product-detail-image:hover {
    opacity: 0.9;
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.product-detail-image img,
.product-detail-image .product-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.product-detail-info h2 {
    font-family: 'PT Serif', serif;
    font-size: 1.8rem;
    color: var(--cream);
    margin-bottom: 10px;
}

.product-detail-category {
    font-family: 'PT Mono', monospace;
    font-size: 0.8rem;
    color: var(--cherry-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.product-detail-price {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.product-detail-description {
    color: var(--cream);
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 0;
}

.product-detail-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 9;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.description-wrapper {
    margin-bottom: 15px;
}

.btn-show-more {
    background: none;
    border: none;
    color: var(--cherry-light);
    font-size: inherit;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
    display: inline;
}

.btn-show-more:hover {
    color: var(--gold);
}

.product-detail-details {
    color: rgba(245, 240, 230, 0.6);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.btn-add-to-cart {
    width: 100%;
    padding: 18px;
    background: var(--cherry);
    border: none;
    color: var(--cream);
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-to-cart:hover {
    background: var(--cherry-light);
}

.btn-add-to-cart:disabled {
    background: rgba(245, 240, 230, 0.1);
    cursor: not-allowed;
}

/* Форма заказа */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--cream);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: rgba(245, 240, 230, 0.05);
    border: 1px solid rgba(245, 240, 230, 0.2);
    color: var(--cream);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--cherry-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(245, 240, 230, 0.4);
}

.form-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    color: var(--gold);
    margin: 30px 0 20px;
    letter-spacing: 0.1em;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group-small {
    flex: 0 0 120px;
}

.form-group-large {
    flex: 1;
}

.order-summary {
    background: rgba(245, 240, 230, 0.03);
    padding: 20px;
    margin: 30px 0;
}

.order-summary h3 {
    font-family: 'Oswald', sans-serif;
    color: var(--gold);
    margin-bottom: 15px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(245, 240, 230, 0.1);
    font-size: 0.9rem;
    color: var(--cream);
}

.order-item-qty {
    color: var(--cherry-light);
    font-family: 'PT Mono', monospace;
    font-size: 0.85rem;
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    margin-top: 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 1.3rem;
    color: var(--gold);
}

.btn-submit {
    width: 100%;
    padding: 18px;
    background: var(--cherry);
    border: none;
    color: var(--cream);
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: var(--cherry-light);
}

/* Уведомление */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--cherry);
    color: var(--cream);
    padding: 20px 30px;
    font-family: 'PT Mono', monospace;
    font-size: 0.9rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #2d5a27;
}

.toast.error {
    background: #8B0000;
}

/* Лайтбокс для полноэкранного просмотра изображения */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: var(--cream);
    font-size: 3rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: var(--cream);
    width: 50px;
    height: 80px;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s;
    z-index: 2001;
}

.lightbox-nav:hover {
    opacity: 1;
    background: var(--cherry);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-nav.hidden {
    display: none;
}

/* Модальное окно корзины */
.cart-modal-content {
    max-width: 500px;
}

.cart-modal-items {
    max-height: 400px;
    overflow-y: auto;
}

.cart-modal-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(245, 240, 230, 0.1);
}

.cart-modal-item:last-child {
    border-bottom: none;
}

.cart-modal-item-info {
    flex: 1;
    min-width: 0;
}

.cart-modal-item-title {
    color: var(--cream);
    font-family: 'PT Serif', serif;
    font-size: 1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-modal-item-price {
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
}

.cart-modal-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-modal-item-quantity button {
    width: 32px;
    height: 32px;
    background: rgba(245, 240, 230, 0.1);
    border: 1px solid rgba(245, 240, 230, 0.2);
    color: var(--cream);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal-item-quantity button:hover {
    background: var(--cherry);
    border-color: var(--cherry);
}

.cart-modal-item-quantity span {
    color: var(--cream);
    font-family: 'PT Mono', monospace;
    min-width: 24px;
    text-align: center;
}

.cart-modal-item-remove {
    background: none;
    border: none;
    color: rgba(245, 240, 230, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.cart-modal-item-remove:hover {
    color: var(--cherry-light);
}

.cart-modal-empty {
    text-align: center;
    padding: 40px 0;
    display: none;
}

.cart-modal-empty.show {
    display: block;
}

.cart-modal-empty p {
    color: rgba(245, 240, 230, 0.5);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.cart-modal-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(245, 240, 230, 0.2);
    margin-top: 20px;
}

.cart-modal-footer.hidden {
    display: none;
}

.cart-modal-total {
    display: flex;
    justify-content: space-between;
    font-family: 'Oswald', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.cart-modal-total span:first-child {
    color: var(--cream);
}

.cart-modal-total span:last-child {
    color: var(--gold);
}

.cart-modal-actions {
    display: flex;
    gap: 15px;
}

.btn-continue {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: 1px solid rgba(245, 240, 230, 0.3);
    color: var(--cream);
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-continue:hover {
    border-color: var(--cream);
    background: rgba(245, 240, 230, 0.05);
}

.btn-checkout-modal {
    flex: 1;
    padding: 15px;
    background: var(--cherry);
    border: none;
    color: var(--cream);
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-checkout-modal:hover {
    background: var(--cherry-light);
}

/* Адаптивность */
@media (max-width: 1024px) {
    .shop-content {
        grid-template-columns: 1fr;
    }

    .shop-filters {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .filter-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 0;
    }

    .filter-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .shop-filters {
        grid-template-columns: 1fr;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-detail-image {
        position: static;
        aspect-ratio: 4/3;
        max-height: 300px;
    }

    .product-detail-gallery {
        position: static;
    }

    .gallery-main {
        aspect-ratio: 4/3;
        max-height: 300px;
    }

    .gallery-nav {
        opacity: 0.7;
    }

    .gallery-thumbs {
        justify-content: center;
    }

    .lightbox-nav {
        width: 40px;
        height: 60px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .product-detail-info {
        padding-bottom: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .modal-body {
        padding: 30px 20px;
    }

    .cart-modal-actions {
        flex-direction: column;
    }

    .cart-modal-item {
        flex-wrap: wrap;
    }

    .cart-modal-item-info {
        flex: 1 1 100%;
        margin-bottom: 10px;
    }

    .cart-modal-item-quantity {
        flex: 1;
    }
}
