/* PlantCupid WooCommerce Sync — Frontend Styles
 *
 * Brand Palette
 *   Bloom     : #E4E9E1  (--pc-bloom)
 *   Sage      : #AFDABF  (--pc-sage)
 *   Mint      : #559A75  (--pc-mint)
 *   Amazon    : #306C49  (--pc-amazon)
 *   Deep Teal : #00372A  (--pc-deep-teal)
 *   White     : #ffffff  (--pc-white)
 *
 * Greyscale
 *   Iron      : #D1D3D4  (--pc-iron)
 *   Aluminium : #A7A9AC  (--pc-aluminium)
 *   Stone     : #808285  (--pc-stone)
 *   Nevada    : #6D6E71  (--pc-nevada)
 *   Thunder   : #231F20  (--pc-thunder)
 * ─────────────────────────────────────────────────────────────── */

/* ── Custom Properties ──────────────────────────────────────────── */
:root {
    --pc-bloom:       #E4E9E1;
    --pc-sage:        #AFDABF;
    --pc-mint:        #559A75;
    --pc-amazon:      #306C49;
    --pc-deep-teal:   #00372A;
    --pc-white:       #ffffff;

    /* Greyscale */
    --pc-iron:        #D1D3D4;
    --pc-aluminium:   #A7A9AC;
    --pc-stone:       #808285;
    --pc-nevada:      #6D6E71;
    --pc-thunder:     #231F20;
}

/* ── Tiered Pricing Wrapper ─────────────────────────────────────── */
/* No outer margin — spacing is controlled by the Elementor widget container */
.pcws-tiered-pricing-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pcws-product-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--pc-deep-teal);
}

.pcws-base-price {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcws-crossed-price {
    text-decoration: line-through;
    color: #A7A9AC;
    font-size: 18px;
}

.pcws-current-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--pc-deep-teal);
}

.pcws-stock-info {
    margin-bottom: 20px;
    color: #6D6E71;
    font-size: 14px;
}

/* ── Tiered Pricing Table ───────────────────────────────────────── */
.pcws-tiered-pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.pcws-pricing-tier {
    border: 2px solid #AFDABF;     /* Sage — inactive border */
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all .3s ease;
    cursor: pointer;
    background: #fff;
}

.pcws-pricing-tier:hover {
    border-color: var(--pc-mint);
    box-shadow: 0 2px 8px rgba(85, 154, 117, .2);
}

.pcws-pricing-tier.active {
    border-color: var(--pc-mint);
    background: var(--pc-bloom);
    box-shadow: 0 4px 12px rgba(85, 154, 117, .3);
}

.pcws-pricing-tier.active .pcws-tier-price  { color: #306C49; } /* Amazon — on Bloom bg */
.pcws-pricing-tier.active .pcws-tier-range  { color: #306C49; }

.pcws-tier-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--pc-deep-teal);
    margin-bottom: 8px;
}

.pcws-discount-badge {
    display: inline-block;
    background: var(--pc-mint);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 5px;
}

/* ── Sale badges ────────────────────────────────────────────────── */
.pcws-sale-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pcws-base-sale-badge {
    font-size: 13px;
    padding: 3px 10px;
    margin-right: 6px;
    vertical-align: middle;
}

.pcws-tier-original-price {
    display: block;
    color: #A7A9AC;
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.pcws-tier-sale-price {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #c0392b;
}

.pcws-pricing-tier.pcws-tier-on-sale { border-color: #c0392b; }

.pcws-pricing-tier.pcws-tier-on-sale:hover,
.pcws-pricing-tier.pcws-tier-on-sale.active {
    border-color: #a93226;
    box-shadow: 0 4px 12px rgba(192, 57, 43, .2);
}

.pcws-current-price.pcws-sale-price { color: #c0392b; }

.pcws-crossed-price.pcws-crossed-regular { font-size: 16px; }

.pcws-tier-range {
    font-size: 14px;
    color: #6D6E71;
}

/* ── Quantity Total Display ─────────────────────────────────────── */
.pcws-quantity-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--pc-bloom);
    border-radius: 8px;
    margin-bottom: 20px;
    gap: 12px;
}

/* ── Quantity Stepper ───────────────────────────────────────────── */
.pcws-qty-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pcws-qty-btn {
    width: 34px;
    height: 34px;
    border: 2px solid var(--pc-amazon);
    background: transparent;
    color: var(--pc-deep-teal);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .15s ease, color .15s ease;
    user-select: none;
}

.pcws-qty-btn:hover {
    background: var(--pc-amazon);
    color: var(--pc-white);
}

.pcws-qty-btn:active  { transform: scale(.9); }
.pcws-qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.pcws-qty-btn:disabled:hover { background: transparent; color: var(--pc-deep-teal); }

.pcws-qty-number {
    min-width: 32px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--pc-amazon);
}

.pcws-product-name-small {
    flex: 1;
    padding: 0 12px;
    font-size: 14px;
    color: #6D6E71;
}

.pcws-total-price {
    font-size: 28px;
    font-weight: bold;
    color: var(--pc-deep-teal);
}

/* ── Quantity Input ─────────────────────────────────────────────── */
.woocommerce div.product form.cart .quantity input.qty {
    width: 80px !important;
    height: 46px !important;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #D1D3D4;
    border-radius: 6px;
    padding: 0 !important;
    margin: 0 10px 0 0 !important;
    box-sizing: border-box;
    transition: border-color .2s ease;
}

.woocommerce div.product form.cart .quantity input.qty:hover {
    border-color: var(--pc-sage);
}

.woocommerce div.product form.cart .quantity input.qty:focus {
    border-color: var(--pc-amazon);
    outline: none;
    box-shadow: 0 0 0 2px rgba(48, 108, 73, .12);
}

.woocommerce div.product form.cart .quantity input.qty::-webkit-inner-spin-button,
.woocommerce div.product form.cart .quantity input.qty::-webkit-outer-spin-button {
    opacity: 1;
    cursor: pointer;
}

/* ── Product Details Tab ────────────────────────────────────────── */
.pcws-product-details table.shop_attributes {
    border: 1px solid #D1D3D4;
}

.pcws-product-details table.shop_attributes th {
    width: 30%;
    font-weight: 600;
    background: var(--pc-bloom);
}

.pcws-product-details table.shop_attributes td {
    background: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────
   WIDGET THEME OVERRIDES — Commerce Widgets
   Applied via a .pcws-widget-theme wrapper div emitted by the widget/shortcode
   when a theme parameter is set.  Mirrors the mock design colour logic.

   pcws-theme-sage-bloom    Brand palette · white cards, Sage borders
   pcws-theme-forest-white  Deep Forest palette · white variation/tier cards
   pcws-theme-forest-sage   Deep Forest palette · Sage (#AFDABF) cards
   ───────────────────────────────────────────────────────────────────────── */

/* ── Sage Bloom — Variations ──────────────────────────────────────────── */
.pcws-theme-sage-bloom .wc-section-heading { color: #306C49; }
.pcws-theme-sage-bloom .wc-group-variation { background: #fff; border-color: #AFDABF; }
.pcws-theme-sage-bloom .wc-group-variation:hover { border-color: #559A75; }
.pcws-theme-sage-bloom .wc-group-variation.current { background: #E4E9E1; border-color: #559A75; }
.pcws-theme-sage-bloom .wc-group-variation-name  { color: #00372A; }
.pcws-theme-sage-bloom .wc-group-variation-price { color: #00372A; }
.pcws-theme-sage-bloom .wc-group-variation-stock { color: #6D6E71; }
.pcws-theme-sage-bloom .wc-group-variation.current .wc-group-variation-name  { color: #00372A; }
.pcws-theme-sage-bloom .wc-group-variation.current .wc-group-variation-price { color: #00372A; }
.pcws-theme-sage-bloom .wc-group-variation.current .wc-group-variation-stock { color: #306C49; }

/* ── Sage Bloom — Tiered Pricing ─────────────────────────────────────── */
.pcws-theme-sage-bloom .pcws-pricing-tier { background: #fff; border-color: #AFDABF; }
.pcws-theme-sage-bloom .pcws-pricing-tier:hover { border-color: #559A75; }
.pcws-theme-sage-bloom .pcws-pricing-tier.active { background: #E4E9E1; border-color: #559A75; }
.pcws-theme-sage-bloom .pcws-tier-price { color: #00372A; }
.pcws-theme-sage-bloom .pcws-pricing-tier.active .pcws-tier-price { color: #306C49; }
.pcws-theme-sage-bloom .pcws-pricing-tier.active .pcws-tier-range { color: #306C49; }
.pcws-theme-sage-bloom .pcws-discount-badge { background: #559A75; color: #fff; }
.pcws-theme-sage-bloom .pcws-quantity-total { background: #E4E9E1; border: 1px solid #AFDABF; }
.pcws-theme-sage-bloom .pcws-qty-number { color: #306C49; }
.pcws-theme-sage-bloom .pcws-qty-btn { border-color: #306C49; color: #00372A; }
.pcws-theme-sage-bloom .pcws-qty-btn:hover { background: #306C49; color: #E4E9E1; }
.pcws-theme-sage-bloom .pcws-qty-btn:disabled:hover { background: transparent; color: #00372A; }
.pcws-theme-sage-bloom .pcws-product-name-small { color: #6D6E71; }
.pcws-theme-sage-bloom .pcws-total-price { color: #00372A; }

/* ── Forest White — Variations ────────────────────────────────────────── */
.pcws-theme-forest-white .wc-section-heading { color: #306C49; }
.pcws-theme-forest-white .wc-group-variation { background: #fff; border-color: #306C49; }
.pcws-theme-forest-white .wc-group-variation:hover { border-color: #559A75; }
.pcws-theme-forest-white .wc-group-variation.current { background: #00372A; border-color: #559A75; }
.pcws-theme-forest-white .wc-group-variation-name  { color: #00372A; }
.pcws-theme-forest-white .wc-group-variation-price { color: #00372A; }
.pcws-theme-forest-white .wc-group-variation-stock { color: #6D6E71; }
.pcws-theme-forest-white .wc-group-variation.current .wc-group-variation-name  { color: #AFDABF; }
.pcws-theme-forest-white .wc-group-variation.current .wc-group-variation-price { color: #AFDABF; }
.pcws-theme-forest-white .wc-group-variation.current .wc-group-variation-stock { color: #E4E9E1; }

/* ── Forest White — Tiered Pricing ───────────────────────────────────── */
.pcws-theme-forest-white .pcws-pricing-tier { background: #fff; border-color: #306C49; }
.pcws-theme-forest-white .pcws-pricing-tier:hover { border-color: #559A75; }
.pcws-theme-forest-white .pcws-pricing-tier.active { background: #00372A; border-color: #559A75; }
.pcws-theme-forest-white .pcws-tier-price { color: #00372A; }
.pcws-theme-forest-white .pcws-pricing-tier.active .pcws-tier-price { color: #AFDABF; }
.pcws-theme-forest-white .pcws-pricing-tier.active .pcws-tier-range { color: #E4E9E1; }
.pcws-theme-forest-white .pcws-discount-badge { background: #559A75; color: #fff; }
.pcws-theme-forest-white .pcws-quantity-total { background: #AFDABF; border: 1px solid #306C49; }
.pcws-theme-forest-white .pcws-qty-number { color: #00372A; }
.pcws-theme-forest-white .pcws-qty-btn { border-color: #00372A; color: #00372A; }
.pcws-theme-forest-white .pcws-qty-btn:hover { background: #00372A; color: #AFDABF; }
.pcws-theme-forest-white .pcws-qty-btn:disabled:hover { background: transparent; color: #00372A; }
.pcws-theme-forest-white .pcws-product-name-small { color: #306C49; }
.pcws-theme-forest-white .pcws-total-price { color: #00372A; }

/* ── Forest Sage — Variations ─────────────────────────────────────────── */
.pcws-theme-forest-sage .wc-section-heading { color: #306C49; }
.pcws-theme-forest-sage .wc-group-variation { background: #AFDABF; border-color: #306C49; }
.pcws-theme-forest-sage .wc-group-variation:hover { border-color: #559A75; }
.pcws-theme-forest-sage .wc-group-variation.current { background: #00372A; border-color: #559A75; }
.pcws-theme-forest-sage .wc-group-variation-name  { color: #00372A; }
.pcws-theme-forest-sage .wc-group-variation-price { color: #00372A; }
.pcws-theme-forest-sage .wc-group-variation-stock { color: #306C49; }
.pcws-theme-forest-sage .wc-group-variation.current .wc-group-variation-name  { color: #AFDABF; }
.pcws-theme-forest-sage .wc-group-variation.current .wc-group-variation-price { color: #AFDABF; }
.pcws-theme-forest-sage .wc-group-variation.current .wc-group-variation-stock { color: #E4E9E1; }

/* ── Forest Sage — Tiered Pricing ────────────────────────────────────── */
.pcws-theme-forest-sage .pcws-pricing-tier { background: #AFDABF; border-color: #306C49; }
.pcws-theme-forest-sage .pcws-pricing-tier:hover { border-color: #559A75; }
.pcws-theme-forest-sage .pcws-pricing-tier.active { background: #00372A; border-color: #559A75; }
.pcws-theme-forest-sage .pcws-tier-price { color: #00372A; }
.pcws-theme-forest-sage .pcws-pricing-tier.active .pcws-tier-price { color: #AFDABF; }
.pcws-theme-forest-sage .pcws-pricing-tier.active .pcws-tier-range { color: #E4E9E1; }
.pcws-theme-forest-sage .pcws-discount-badge { background: #306C49; color: #fff; }
.pcws-theme-forest-sage .pcws-quantity-total { background: #00372A; border: 1px solid #306C49; }
.pcws-theme-forest-sage .pcws-qty-number { color: #AFDABF; }
.pcws-theme-forest-sage .pcws-qty-btn { border-color: #559A75; color: #AFDABF; }
.pcws-theme-forest-sage .pcws-qty-btn:hover { background: #559A75; color: #00372A; }
.pcws-theme-forest-sage .pcws-qty-btn:disabled:hover { background: transparent; color: #AFDABF; }
.pcws-theme-forest-sage .pcws-product-name-small { color: #AFDABF; }
.pcws-theme-forest-sage .pcws-total-price { color: #AFDABF; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pcws-tiered-pricing-table {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .pcws-product-name { font-size: 20px; }
    .pcws-quantity-total {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .pcws-product-name-small { padding: 0; }
    .woocommerce div.product form.cart .quantity input.qty {
        width: 70px !important;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .pcws-tiered-pricing-table { grid-template-columns: 1fr 1fr; }
    .pcws-tier-price            { font-size: 18px; }
    .pcws-total-price,
    .pcws-qty-label             { font-size: 24px; }
}
