/* ===================================
   ZAMOK — Catalog Card (Product Preview)
   Карточка-превью в каталоге
   =================================== */

.product-card {
    background: transparent;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: .2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transition: .2s;
}

/* Badges */
.product-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

/* Quick actions (top-right) */
.product-card__actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
    opacity: 0;
    transform: translateX(8px);
    transition: all var(--transition-base);
}

.product-card:hover .product-card__actions {
    opacity: 1;
    transform: translateX(0);
}

.product-card__action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-secondary);
    box-shadow: var(--shadow-sm);
}

.product-card__action-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.product-card__action-btn--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.product-card__action-btn svg {
    width: 18px;
    height: 18px;
}

/* Image */
.product-card__image {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--color-white);
    overflow: hidden;
}

.product-card__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-card__img {
    transform: scale(1.05);
}

/* Content */
.product-card__content {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--color-white);
    border-top: 1px solid var(--color-border-light);
}

.product-card__sku {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-bottom: 6px;
}

.product-card__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card__name a {
    color: inherit;
    text-decoration: none;
}

.product-card__name a:hover {
    color: var(--color-primary);
}

/* Price block */
.product-card__price {
    margin-top: auto;
    margin-bottom: 12px;
}

.product-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 0;
}

.product-card__price-current {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-primary);
    line-height: 1.2;
}

.product-card__price-old {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.product-card__price-levels {
    margin-top: 2px;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.product-card__price-level {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

/* Stock wrapper - each warehouse on new line */
.product-card__stock-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

/* Stock */
.product-card__stock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
}

.product-card__stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-card__stock--in .product-card__stock-dot {
    background: var(--color-success);
}

.product-card__stock--low .product-card__stock-dot {
    background: var(--color-warning);
}

.product-card__stock--out .product-card__stock-dot {
    background: var(--color-text-muted);
}

.product-card__stock--in {
    color: var(--color-success);
}

.product-card__stock--low {
    color: var(--color-warning);
}

.product-card__stock--out {
    color: var(--color-text-muted);
}

/* Add to cart */
.product-card__cart-btn {
    width: 100%;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
    white-space: nowrap;
}

.product-card__cart-btn:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(225, 30, 40, 0.22);
}

.product-card__cart-btn svg {
    width: 16px;
    height: 16px;
}

.product-card__cart-btn--order {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-border);
}

.product-card__cart-btn--order:hover {
    border-color: var(--color-text);
    background: var(--color-bg-secondary);
    box-shadow: none;
    color: var(--color-text);
}

/* ===== LIST VIEW ===== */
.catalog-products__grid--list .product-card {
    flex-direction: row;
    align-items: stretch;
}

.catalog-products__grid--list .product-card:hover {
    transform: none;
}

.catalog-products__grid--list .product-card__image {
    width: 200px;
    min-height: 200px;
    aspect-ratio: auto;
    flex-shrink: 0;
}

.catalog-products__grid--list .product-card__badges {
    top: 8px;
    left: 8px;
}

.catalog-products__grid--list .product-card__actions {
    top: 8px;
    right: auto;
    left: 160px;
    opacity: 0;
}

.catalog-products__grid--list .product-card:hover .product-card__actions {
    opacity: 1;
}

.catalog-products__grid--list .product-card__content {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    border-top: none;
    border-left: 1px solid var(--color-border-light);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 0;
}

.catalog-products__grid--list .product-card__sku {
    width: 100%;
    margin-bottom: 4px;
}

.catalog-products__grid--list .product-card__name {
    width: 60%;
    -webkit-line-clamp: unset;
    font-size: var(--font-size-base);
    margin-bottom: 8px;
}

.catalog-products__grid--list .product-card__price {
    width: 40%;
    text-align: right;
    margin: 0 0 8px 0;
}

.catalog-products__grid--list .product-card__price-row {
    justify-content: flex-end;
}

.catalog-products__grid--list .product-card__stock-wrapper {
    width: 60%;
    margin-bottom: 0;
}

.catalog-products__grid--list .product-card__cart-btn {
    width: auto;
    padding: 10px 24px;
    margin-left: auto;
    align-self: flex-end;
}

@media (max-width: 900px) {
    .product-card__actions {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .catalog-products__grid--list .product-card {
        flex-direction: column;
    }

    .catalog-products__grid--list .product-card__image {
        width: 100%;
        aspect-ratio: 1;
    }

    .catalog-products__grid--list .product-card__content {
        flex-direction: column;
    }

    .catalog-products__grid--list .product-card__name,
    .catalog-products__grid--list .product-card__price,
    .catalog-products__grid--list .product-card__stock-wrapper {
        width: 100%;
        text-align: left;
    }

    .catalog-products__grid--list .product-card__price-row {
        justify-content: flex-start;
    }

    .catalog-products__grid--list .product-card__cart-btn {
        width: 100%;
    }
}

/* ===== PRODUCT IMAGE SLIDER ===== */
.product-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-slider__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-slider__img--active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

/* Arrows — hidden until hover */
.product-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--color-text);
    padding: 0;
}

.product-slider__arrow--prev { left: 6px; }
.product-slider__arrow--next { right: 6px; }

.product-card:hover .product-slider__arrow {
    opacity: 1;
}

.product-slider__arrow:hover {
    background: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dots */
.product-slider__dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.product-card:hover .product-slider__dots {
    opacity: 1;
}

.product-slider__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.product-slider__dot--active {
    background: var(--color-primary);
    transform: scale(1.3);
}

.product-slider__dot:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Override default card hover zoom for slider images */
.product-card:hover .product-slider .product-card__img {
    transform: none;
}
