/**
 * Product page – buy box.
 *
 * Part of the product page styles, see css/single-product.css.
 *
 * Sections:
 *   1. Buy box (brand, title, price, ESTO, excerpt, stock line)
 *   2. Assurance list
 *   3. Mobile sticky buy bar (shown by js/single-product.js)
 *
 * @package KauplusRattapood
 */

/* =========================================================================
   1. Buy box
   ========================================================================= */
.kr-pdp-buy {
    position: sticky;
    top: 16px;
}

.kr-pdp-brand {
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-gray-500);
    text-decoration: none;
}

.kr-pdp-brand:hover {
    color: var(--color-black);
}

.kr-pdp-buy .product_title {
    margin: 4px 0 10px;
    font-size: 28px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-black);
    text-wrap: balance;
}

/* Price: black and calm; a sale shows the new price first, the old one after */
.kr-pdp-buy > .price {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: baseline !important;
    gap: 4px 10px !important;
    margin: 0;
    font-size: 24px;
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.01em;
    color: var(--color-black);
}

.kr-pdp-buy > .price ins,
.kr-pdp-buy > .price ins * {
    color: var(--color-black) !important;
    font-weight: var(--font-weight-semibold) !important;
}

.kr-pdp-buy > .price del,
.kr-pdp-buy > .price del * {
    order: 3 !important;
    font-size: 16px !important;
    color: var(--color-gray-400) !important;
}

/* ESTO: one muted line under the price */
.kr-pdp-buy .esto-calculator {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--color-gray-500);
}

.kr-pdp-buy .woocommerce-product-details__short-description {
    max-width: 46ch;
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-gray-500);
}

.kr-pdp-buy .woocommerce-product-details__short-description p {
    margin: 0 0 8px;
}

/* Stock / delivery line (kauplusrattapood_stock_badge) */
.kr-pdp .kr-stock-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 0;
    font-size: 14px;
    color: var(--color-black);
}

.kr-pdp .kr-stock-badge__dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-gray-300);
}

.kr-pdp .kr-stock-badge--in-stock .kr-stock-badge__dot { background: #22c55e; }
.kr-pdp .kr-stock-badge--backorder .kr-stock-badge__dot { background: #f59e0b; }
.kr-pdp .kr-stock-badge--out-of-stock { color: var(--color-gray-500); }

/* Delivery fit by size (includes/shipping-sizes-display.php) */
.kr-pdp .kr-pdp-fit {
    margin: 4px 0 0 15px; /* lines up with the stock text, past its dot */
    font-size: 13px;
    color: var(--color-gray-500);
}

/* =========================================================================
   2. Assurance list
   ========================================================================= */
.kr-pdp-assure {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--color-gray-200);
}

.kr-pdp-assure li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--color-gray-200);
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--color-black);
}

.kr-pdp-assure svg {
    margin-top: 2px;
}

.kr-pdp-assure span {
    color: var(--color-gray-500);
}

.kr-pdp-assure a {
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    text-decoration: none;
}

.kr-pdp-assure a.kr-pdp-assure__terms {
    font-weight: var(--font-weight-normal);
    color: inherit;
    border-bottom: 1px solid currentColor;
}

/* =========================================================================
   3. Mobile sticky buy bar (shown by js/single-product.js)
   ========================================================================= */
.kr-pdp-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--color-gray-200);
    background: var(--color-white);
    box-shadow: 0 -8px 20px -12px rgba(0, 0, 0, 0.15);
}

.kr-pdp-sticky[hidden] {
    display: none;
}

.kr-pdp-sticky__price {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-black);
    white-space: nowrap;
}

.kr-pdp-sticky__price del {
    display: none !important;
}

.kr-pdp-sticky__price ins {
    color: inherit !important;
}

.kr-pdp-sticky__btn {
    height: 46px;
    border: 0;
    border-radius: 10px;
    background: var(--color-primary);
    font: inherit;
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    cursor: pointer;
}

@media (min-width: 969px) {
    .kr-pdp-sticky {
        display: none !important;
    }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 968px) {
    .kr-pdp-buy {
        position: static;
    }

    .kr-pdp-buy .product_title {
        font-size: 22px;
    }

    .kr-pdp-buy > .price {
        font-size: 21px;
    }
}
