/**
 * Quantity Discount Boxes - Frontend Styles
 *
 * @package EV_Frozen_Products
 * @since   2.7.0
 */

/* ── Container ──────────────────────────────── */
.evfp-qty-discounts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0 20px;
    width: 100%;
    max-width: 500px;
}

/* ── Individual tier card ───────────────────── */
.evfp-qty-tier {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 2px solid #d4ddd7;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: #fff;
    overflow: visible;
}

.evfp-qty-tier:hover {
    border-color: #4a7c59;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.15);
    transform: translateY(-1px);
}

.evfp-qty-tier.evfp-tier-active {
    border-color: #4a7c59;
    background: #f5faf6;
    box-shadow: 0 0 0 1px #4a7c59, 0 2px 8px rgba(74, 124, 89, 0.2);
}

/* ── Discount badge (top-right) ─────────────── */
.evfp-tier-discount-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: #4a7c59;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 0 8px 0 8px;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* ── Free shipping badge (top-left) ─────────── */
.evfp-free-shipping-badge {
    position: absolute;
    top: -1px;
    left: -1px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #2e7d32;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px 0 8px 0;
    line-height: 1.4;
}

.evfp-free-shipping-badge svg {
    flex-shrink: 0;
}

/* ── Body (info + prices) ───────────────────── */
.evfp-tier-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.evfp-tier-info {
    display: flex;
    flex-direction: column;
}

.evfp-tier-info strong {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.evfp-tier-units {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* ── Prices ──────────────────────────────────── */
.evfp-tier-prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.evfp-original-price {
    font-size: 13px;
    color: #999;
    line-height: 1.3;
}

.evfp-original-price del {
    text-decoration: line-through;
}

.evfp-discount-price {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

/* ── Active tier price highlight ─────────────── */
.evfp-qty-tier.evfp-tier-active .evfp-discount-price {
    color: #4a7c59;
}

/* ── Mobile responsive ──────────────────────── */
@media (max-width: 480px) {
    .evfp-qty-discounts {
        max-width: 100%;
        gap: 8px;
    }

    .evfp-qty-tier {
        padding: 12px 14px;
    }

    .evfp-tier-info strong {
        font-size: 15px;
    }

    .evfp-discount-price {
        font-size: 15px;
    }

    .evfp-tier-discount-badge {
        font-size: 11px;
        padding: 3px 10px;
    }

    .evfp-free-shipping-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* ── WoodMart specifics ──────────────────────── */
.single-product .summary .evfp-qty-discounts {
    clear: both;
}

/* ── Admin tab styles ────────────────────────── */
.evfp-qty-tiers-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.evfp-qty-tiers-table th,
.evfp-qty-tiers-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.evfp-qty-tiers-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
}

.evfp-qty-tiers-table input[type="number"] {
    width: 70px;
}

.evfp-qty-products-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.evfp-qty-products-table th,
.evfp-qty-products-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.evfp-qty-products-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
}

.evfp-qty-products-table .evfp-product-row {
    transition: background-color 0.15s;
}

.evfp-qty-products-table .evfp-product-row:hover {
    background: #f5f5f5;
}

.evfp-qty-products-table input[type="text"],
.evfp-qty-products-table input[type="number"] {
    width: 100%;
    max-width: 120px;
}

.evfp-qty-add-product-wrap {
    margin-bottom: 16px;
}

.evfp-qty-add-product-wrap .select2-container {
    min-width: 300px;
}

/* ── Force visible on mobile (override theme/builder hiders) ──────────────── */
@media (max-width: 1024px) {
    .evfp-qty-discounts,
    .evfp-qty-discounts .evfp-qty-tier,
    .single-product .evfp-qty-discounts {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .evfp-qty-discounts {
        flex-direction: column !important;
    }
}

/* ── Hide EVFP boxes inside Woodmart sticky add-to-cart bar ──────────────── */
.wd-sticky-btn .evfp-qty-discounts,
.wd-sticky-btn-content .evfp-qty-discounts,
.wd-sticky-btn-info .evfp-qty-discounts,
.sticky-add-to-cart .evfp-qty-discounts,
.wd-sticky-btn-cart .evfp-qty-discounts {
    display: none !important;
}
