/* Tootekaart v2 (headrehvid/product-card-v2) — laetakse ainult bloki olemasolul.
   Grid: woocommerce/product-template className "hr-card-v2-grid" (vana .hnd-woo-tooted-grid stiile ei kasutata). */

.hr-card-v2-grid {
    --hr-card-red: #C8102E;
    --hr-card-text: #1A1A1A;
    --hr-card-muted: #6B6B6B;
    --hr-card-line: #E6E6E3;
    --hr-card-navy: #1F3A5F;
    gap: 16px !important;
}

/* Kaart = product-template li */
.hr-card-v2-grid > .wc-block-product {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 4px 14px rgba(20, 20, 20, .06);
    transition: box-shadow .2s ease;
    font-family: var(--font-primary, inherit);
    text-align: left;
}
.hr-card-v2-grid > .wc-block-product:hover {
    box-shadow: 0 2px 4px rgba(20, 20, 20, .06), 0 10px 24px rgba(20, 20, 20, .10);
}

/* Pilt heledas kastis */
.hr-card-v2-grid .wc-block-components-product-image {
    margin: 0 0 14px !important;
    background: #F6F6F4;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 7 / 5;
    height: auto !important;
}
.hr-card-v2-grid .wc-block-components-product-image a {
    display: block;
    height: 100% !important;
}
.hr-card-v2-grid .wc-block-components-product-image img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    padding: 0 8%; /* üleval/all vahet pole — rehv täidab ala kõrguse */
    box-sizing: border-box;
    mix-blend-mode: multiply;
}

/* Sisu */
.hr-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}
.hr-card p { margin: 0; }

.hr-card-brand {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--hr-card-muted);
}
.hr-card-title {
    margin: 2px 0 2px !important;
    font-size: 17px !important;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.hr-card-title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* väga pikk mustri nimi */
    overflow: hidden;
    color: var(--hr-card-text);
    text-decoration: none;
}
.hr-card-title a:hover { color: var(--hr-card-red); }
.hr-card-size {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #333;
    margin-bottom: 10px !important;
}

/* Pillid */
.hr-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}
.hr-card-pill {
    margin: 0;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}
.hr-card-pill--type  { background: #EAF0F8; color: var(--hr-card-navy); }
.hr-card-pill--warn  { background: #FDEFD8; color: #8A4B00; }
.hr-card-pill--ok    { background: #E3F1E6; color: #1E6B34; }
.hr-card-pill--van   { background: #ECECEA; color: #333; }
.hr-card-pill--class { background: #fff; border-color: #BCD0E8; color: var(--hr-card-navy); }
.hr-card-pill--feat  { display: inline-flex; align-items: center; gap: 4px; background: #F1F3F5; color: var(--hr-card-text); font-weight: 600; letter-spacing: .02em; }
.hr-card-pill--feat svg { flex: 0 0 auto; }

/* Hinnarida — kaardi põhja */
.hr-card-price {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--hr-card-line);
}
.hr-card-unit {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.hr-card-old,
.hr-card-old .woocommerce-Price-amount.amount {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--hr-card-muted) !important;
}
.hr-card-old--rrp { text-decoration: none; }
.hr-card-now,
.hr-card-now .woocommerce-Price-amount.amount {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--hr-card-red) !important;
    white-space: nowrap;
}
.hr-card-set {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    white-space: nowrap;
}
.hr-card-set-qty {
    font-size: 13px;
    line-height: 1.2;
    color: var(--hr-card-muted);
}
.hr-card-set-sum,
.hr-card-set-sum .woocommerce-Price-amount.amount {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--hr-card-text) !important;
}

/* Tarnerida */
.hr-card-delivery {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 12px 0 0 !important;
    font-size: 13.5px;
    line-height: 1.35;
}
.hr-card-delivery svg { flex: 0 0 auto; margin-top: 1px; }
.hr-card-delivery strong { font-weight: 600; }
.hr-card-delivery--ok    { color: #1E7A3A; }
.hr-card-delivery--order { color: #8A4B00; }
.hr-card-delivery--out   { color: var(--hr-card-muted); font-weight: 600; }

/* Core lisa korvi nupp */
.hr-card-v2-grid .wp-block-woocommerce-product-button {
    margin: 12px 0 0 !important;
    width: 100% !important;
}
.hr-card-v2-grid .wp-block-woocommerce-product-button .wp-block-button__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 44px;
    margin: 0 !important;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--hr-card-red) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
}
.hr-card-v2-grid .wp-block-woocommerce-product-button .wp-block-button__link:hover,
.hr-card-v2-grid .wp-block-woocommerce-product-button .wp-block-button__link:focus-visible {
    background: #A50D26 !important;
}
.hr-card-v2-grid .added_to_cart.wc_forward { display: none !important; }

/* Mobiil: 2 veergu */
@media (max-width: 600px) {
    .hr-card-v2-grid.wc-block-product-template__responsive.columns-4,
    .hr-card-v2-grid.wc-block-product-template__responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    .hr-card-v2-grid > .wc-block-product { padding: 10px; }
    .hr-card-v2-grid .wc-block-components-product-image { margin-bottom: 10px !important; }
    .hr-card-brand { font-size: 11px; }
    .hr-card-title { font-size: 14px !important; }
    .hr-card-size { font-size: 12.5px; }
    .hr-card-size { margin-bottom: 8px !important; }
    .hr-card-pills { gap: 4px; margin-bottom: 10px; }
    .hr-card-pill { padding: 2px 8px; font-size: 11.5px; }

    .hr-card-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding-top: 8px;
    }
    .hr-card-now,
    .hr-card-now .woocommerce-Price-amount.amount { font-size: 21px; }
    .hr-card-set { flex-direction: row; gap: 4px; align-items: baseline; }
    .hr-card-set-qty::after { content: ":"; }
    .hr-card-set-sum,
    .hr-card-set-sum .woocommerce-Price-amount.amount { font-size: 13px; }

    .hr-card-delivery { font-size: 12px; gap: 4px; margin-top: 8px !important; }
    .hr-card-delivery svg { width: 14px; height: 14px; }
    .hr-card-sep { display: none; }
    .hr-card-days { display: block; }

    .hr-card-v2-grid .wp-block-woocommerce-product-button { margin-top: 10px !important; }
    .hr-card-v2-grid .wp-block-woocommerce-product-button .wp-block-button__link { font-size: 15px !important; }
}
