/* ===================================================================================
   HEXXXA SHOP
   Shop page (/obchod/) and product category archives: woocommerce/archive-product.php,
   woocommerce/content-product.php. Builds on hexxxa-base.css (tokens, buttons, notices,
   .star-rating) and hexxxa-components.css (.hexxxa-page-title, .hexxxa-card--raised,
   .hexxxa-card-title, .hexxxa-eyebrow, .hexxxa-tag, .hexxxa-btn--dark/--outline).
   Sharp corners everywhere.
===================================================================================== */

.hexxxa-shop {
    padding: 0 0 var(--hexxxa-space-9);
}

/* ---- Heading ---- */
.hexxxa-shop-header {
    margin: var(--hexxxa-space-6) 0 var(--hexxxa-space-7);
    text-align: center;
}

.hexxxa-shop-header .term-description,
.hexxxa-shop-header .page-description {
    max-width: 720px;
    margin: var(--hexxxa-space-4) auto 0;
    color: var(--hexxxa-text);
    font-size: var(--hexxxa-fs-body);
    line-height: 1.7;
}

.hexxxa-shop-header .term-description > :last-child,
.hexxxa-shop-header .page-description > :last-child {
    margin-bottom: 0;
}

.hexxxa-shop .woocommerce-notices-wrapper:not(:empty) {
    margin-bottom: var(--hexxxa-space-6);
}

/* ---- Grid ---- */
.hexxxa-shop ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---- Product card (.hexxxa-card--raised: white, shadow, 28 px padding) ---- */
.hexxxa-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
}

.hexxxa-product-card-media {
    position: relative;
    display: block;
    padding: var(--hexxxa-space-5) var(--hexxxa-space-5) var(--hexxxa-space-6);
}

.hexxxa-product-card-media img {
    display: block;
    width: 100%;
    max-width: 310px;
    margin: 0 auto;
    transition: transform 0.35s ease;
}

.hexxxa-product-card:hover .hexxxa-product-card-media img {
    transform: translateY(-4px);
}

.hexxxa-product-card.outofstock .hexxxa-product-card-media img {
    opacity: 0.55;
    filter: grayscale(0.35);
}

.hexxxa-product-card-badge {
    position: absolute;
    top: 0;
    left: 0;
}

.hexxxa-product-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
}

.hexxxa-product-card-cat {
    margin-bottom: var(--hexxxa-space-2);
}

.hexxxa-product-card-title a {
    color: inherit;
}

.hexxxa-product-card-title a:hover {
    color: var(--hexxxa-brown);
}

.hexxxa-product-card .price {
    display: block;
    margin: 0 0 var(--hexxxa-space-3);
    color: var(--hexxxa-dark);
    font-family: var(--hexxxa-font-heading);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.hexxxa-product-card .price del {
    margin-right: var(--hexxxa-space-2);
    color: var(--hexxxa-muted);
    font-size: 18px;
    font-weight: 500;
}

.hexxxa-product-card .price ins {
    text-decoration: none;
}

.hexxxa-product-card-rating {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--hexxxa-space-2);
    margin: 0 0 var(--hexxxa-space-3);
}

.hexxxa-product-card-rating .star-rating {
    font-size: 17px;
}

.hexxxa-product-card-rating-count {
    color: var(--hexxxa-muted);
    font-size: var(--hexxxa-fs-small);
    line-height: 1;
}

/* ---- Action: add to cart / sold out ---- */
.hexxxa-product-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--hexxxa-space-3) var(--hexxxa-space-4);
    width: 100%;
    margin-top: auto;
    padding-top: var(--hexxxa-space-3);
}

.hexxxa-product-card-actions .add_to_cart_button::before {
    content: "";
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* AJAX states set by WooCommerce's add-to-cart.js */
.hexxxa-product-card-actions .add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.hexxxa-product-card-actions .add_to_cart_button.loading::before {
    border: 2px solid currentColor;
    border-right-color: transparent;
    background: none;
    -webkit-mask: none;
    mask: none;
    animation: hexxxa-spin 0.8s linear infinite;
}

.hexxxa-product-card-actions .add_to_cart_button.added::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
}

/* "Zobraziť košík" link appended by add-to-cart.js (when the cart redirect is off) */
.hexxxa-product-card-actions .added_to_cart {
    color: var(--hexxxa-brown);
    font-size: var(--hexxxa-fs-small);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--hexxxa-line-strong);
    text-underline-offset: 3px;
}

.hexxxa-product-card-actions .added_to_cart:hover {
    color: var(--hexxxa-brown-dark);
    text-decoration-color: currentColor;
}

@keyframes hexxxa-spin {
    to {
        transform: rotate(360deg);
    }
}

.hexxxa-product-card-stock {
    width: 100%;
    margin: 0;
}

/* ---- Pagination ---- */
.hexxxa-shop .woocommerce-pagination {
    margin-top: var(--hexxxa-space-7);
}

.hexxxa-shop .woocommerce-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--hexxxa-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.hexxxa-shop .woocommerce-pagination .page-numbers a,
.hexxxa-shop .woocommerce-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--hexxxa-space-3);
    border: 1px solid var(--hexxxa-line-strong);
    color: var(--hexxxa-dark);
    font-family: var(--hexxxa-font-heading);
    font-size: var(--hexxxa-fs-body);
}

.hexxxa-shop .woocommerce-pagination .page-numbers a:hover,
.hexxxa-shop .woocommerce-pagination .page-numbers .current {
    border-color: var(--hexxxa-brown);
    background: var(--hexxxa-brown);
    color: var(--hexxxa-white);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .hexxxa-shop ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .hexxxa-shop-header {
        margin: var(--hexxxa-space-5) 0 var(--hexxxa-space-6);
    }

    .hexxxa-shop ul.products {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .hexxxa-product-card-media {
        padding: var(--hexxxa-space-3) var(--hexxxa-space-5) var(--hexxxa-space-5);
    }

    .hexxxa-shop {
        padding-bottom: var(--hexxxa-space-8);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hexxxa-product-card:hover .hexxxa-product-card-media img {
        transform: none;
    }
}
