/**
 * EV Frozen Products - Public styles (WoodMart compatible)
 *
 * @package EV_Frozen_Products
 */

/* ===================== CSS Variables ===================== */
:root {
    --evfp-brand-900: #0d4f3d;
    --evfp-brand-800: #12624b;
    --evfp-brand-700: #2a7b63;
    --evfp-brand-600: #005844;
    --evfp-brand-50: #edf7f4;
    --evfp-radius: 8px;
    --evfp-blue-50: #f0f7ff;
    --evfp-blue-100: #dbeafe;
    --evfp-blue-500: #3b82f6;
    --evfp-blue-800: #1e40af;
    --evfp-green-50: #f0fdf4;
    --evfp-green-300: #86efac;
    --evfp-green-600: #16a34a;
    --evfp-green-700: #15803d;
    --evfp-green-900: #166534;
    --evfp-yellow-50: #fef3c7;
    --evfp-yellow-500: #f59e0b;
    --evfp-yellow-900: #92400e;
}

/* ===================== Overlay ===================== */
#evfp-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#evfp-overlay.evfp-visible {
    opacity: 1;
}

/* ===================== Popup container ===================== */
.evfp-popup-active {
    background: #fff !important;
    border-radius: 12px;
    max-width: 440px;
    width: 92%;
    position: relative !important;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    margin: 0 auto;
}

#evfp-overlay.evfp-visible .evfp-popup-active {
    transform: translateY(0);
}

.evfp-popup-active .evfp-popup-inner {
    padding: 28px 24px 24px;
}

/* Close button */
.evfp-popup-active .evfp-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    left: auto;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
    z-index: 2;
    padding: 0;
    margin: 0;
}

.evfp-popup-active .evfp-popup-close:hover {
    background: #e8e8e8;
    color: #333;
}

/* Header */
.evfp-popup-active .evfp-popup-header {
    text-align: center;
    margin-bottom: 20px;
}

.evfp-popup-active .evfp-popup-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--evfp-blue-50);
    color: var(--evfp-blue-500);
    border-radius: 50%;
    margin-bottom: 12px;
}

.evfp-popup-active .evfp-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.evfp-popup-active .evfp-popup-desc {
    font-size: 16px;
    color: #555;
    line-height: 1.55;
    margin: 0 0 8px;
}

.evfp-popup-active .evfp-popup-savings {
    font-size: 20px;
    font-weight: 900;
    color: #0d4f3d;
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.evfp-popup-active .evfp-popup-desc strong {
    color: var(--evfp-brand-900);
}

/* ===================== Popup option cards (legacy) ===================== */
.evfp-popup-active .evfp-popup-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.evfp-popup-active .evfp-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: var(--evfp-radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
}

.evfp-popup-active .evfp-option-card:hover,
.evfp-popup-active .evfp-option-card:active {
    border-color: var(--evfp-brand-700);
    background: var(--evfp-brand-50);
}

.evfp-popup-active .evfp-option-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--evfp-brand-50);
    color: var(--evfp-brand-900);
    border-radius: 10px;
}

.evfp-popup-active .evfp-option-text {
    flex: 1;
    min-width: 0;
}

.evfp-popup-active .evfp-option-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.evfp-popup-active .evfp-option-desc {
    display: block;
    font-size: 13px;
    color: #666;
    line-height: 1.35;
}

.evfp-popup-active .evfp-option-arrow {
    flex-shrink: 0;
    font-size: 18px;
    color: #bbb;
    transition: color 0.2s;
}

.evfp-popup-active .evfp-option-card:hover .evfp-option-arrow {
    color: var(--evfp-brand-700);
}

/* ===================== Popup new CTA styles ===================== */

/* Actions container */
.evfp-popup-active .evfp-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Primary CTA button (product card style with image) */
.evfp-popup-active .evfp-popup-primary-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: var(--evfp-brand-50);
    color: var(--evfp-brand-900);
    border: 2px solid var(--evfp-brand-700);
    border-radius: var(--evfp-radius);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin-top: 8px;
    box-sizing: border-box;
    font-family: inherit;
    text-decoration: none;
}

.evfp-popup-active .evfp-popup-primary-btn:hover {
    background: #daf0e3;
    border-color: var(--evfp-brand-900);
}

.evfp-popup-active .evfp-popup-primary-btn:active {
    background: #c8e6d0;
}

/* Product image in popup CTA */
.evfp-popup-active .evfp-popup-primary-img {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.evfp-popup-active .evfp-popup-primary-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.evfp-popup-active .evfp-popup-primary-text {
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}

.evfp-popup-active .evfp-popup-primary-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--evfp-brand-700);
    margin-bottom: 2px;
}

.evfp-popup-active .evfp-popup-primary-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--evfp-brand-900);
    margin-bottom: 4px;
}

.evfp-popup-active .evfp-popup-primary-text small {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #666;
    line-height: 1.4;
}

.evfp-popup-active .evfp-popup-primary-arrow {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--evfp-brand-700);
    transition: transform 0.2s;
}

.evfp-popup-active .evfp-popup-primary-btn:hover .evfp-popup-primary-arrow {
    transform: translateX(3px);
}

/* Secondary link (continue with frozen) */
.evfp-popup-active .evfp-popup-secondary {
    display: block;
    text-align: center;
    padding: 12px 0;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
    margin-top: 4px;
}

.evfp-popup-active .evfp-popup-secondary:hover {
    color: #1a1a1a;
}

.evfp-popup-active .evfp-popup-secondary small {
    display: block;
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-top: 2px;
    line-height: 1.4;
}

/* Note under secondary link */
.evfp-popup-active .evfp-popup-secondary-note {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: -4px;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Tertiary link (find distributor) */
.evfp-popup-active .evfp-popup-tertiary {
    display: block;
    text-align: center;
    padding: 8px 0;
    color: #888;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
}

.evfp-popup-active .evfp-popup-tertiary:hover {
    color: #555;
}

/* ===================== Product page: Frozen info block ===================== */
/* Uses WoodMart brand colors - blends with theme, not "AI looking" */
.evfp-frozen-info {
    background: var(--evfp-brand-50);
    border: 1px solid #d1ddd8;
    border-radius: var(--evfp-radius);
    padding: 20px 22px;
    margin: 16px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #222;
}

.evfp-frozen-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.evfp-frozen-info-icon {
    font-size: 18px;
    line-height: 1;
    color: var(--evfp-brand-700);
}

.evfp-frozen-info-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.evfp-frozen-info-desc {
    margin: 0 0 4px;
    color: #222;
}

.evfp-frozen-info-fee {
    margin: 0 0 2px;
    color: #222;
    font-weight: 500;
}

.evfp-frozen-info-fee strong {
    color: #111;
    font-weight: 700;
}

.evfp-frozen-info-min {
    margin: 0;
    color: #555;
    font-size: 14px;
}

/* Tablet recommendation box inside frozen info */
.evfp-tablet-recommend {
    background: #fff;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 18px 20px;
    margin-top: 14px;
}

.evfp-tablet-recommend-title {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.evfp-tablet-recommend-benefits {
    font-size: 16px;
    color: #222;
    line-height: 1.6;
    margin: 0 0 14px;
}

/* WoodMart-style button for tablet link */
.evfp-tablet-recommend-link {
    display: inline-block;
    background: var(--evfp-brand-900);
    color: #fff !important;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 35px;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

.evfp-tablet-recommend-link:hover {
    background: var(--evfp-brand-700);
    color: #fff !important;
    transform: translateY(-1px);
}

.evfp-tablet-recommend-link:active {
    transform: translateY(0);
}

/* Hide info block inside WoodMart sticky add-to-cart bar */
.wd-sticky-btn .evfp-frozen-info,
.woodmart-sticky-btn .evfp-frozen-info,
.sticky-content .evfp-frozen-info,
.wd-sticky-add-to-cart .evfp-frozen-info {
    display: none !important;
}

/* ===================== Shop badge ===================== */
.evfp-frozen-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--evfp-blue-800);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}

/* WoodMart product grid compatibility */
.wd-product .evfp-frozen-badge,
.product-element-bottom .evfp-frozen-badge {
    margin-bottom: 6px;
}

/* ===================== Frozen product picker (cart page) ===================== */
.evfp-frozen-picker {
    margin: 30px 0;
    padding: 24px;
    background: var(--evfp-brand-50);
    border: 1px solid #d1ddd8;
    border-radius: var(--evfp-radius);
}

.evfp-picker-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px;
}

.evfp-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.evfp-picker-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.evfp-picker-card:hover {
    border-color: var(--evfp-brand-700);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.evfp-picker-card.evfp-picker-in-cart {
    border-color: var(--evfp-brand-700);
    background: #f0faf5;
}

.evfp-picker-img {
    display: block;
    margin: 0 auto 6px;
}

.evfp-picker-img img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.evfp-picker-info {
    margin-bottom: 8px;
    flex: 1;
}

.evfp-picker-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #222 !important;
    text-decoration: none !important;
    line-height: 1.3;
    margin-bottom: 4px;
}

.evfp-picker-name:hover {
    color: var(--evfp-brand-700) !important;
}

.evfp-picker-price {
    font-size: 13px;
    font-weight: 700;
    color: #111;
}

.evfp-picker-price del {
    font-weight: 400;
    color: #999;
    font-size: 11px;
}

.evfp-picker-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    width: 100%;
}

.evfp-picker-qty {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.evfp-qty-btn {
    width: 30px !important;
    height: 32px !important;
    background: #f5f5f5 !important;
    border: none !important;
    color: #333 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.evfp-qty-btn:hover {
    background: #e8e8e8 !important;
}

.evfp-qty-input {
    width: 36px !important;
    height: 32px !important;
    text-align: center !important;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

.evfp-qty-input::-webkit-inner-spin-button,
.evfp-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.evfp-picker-add {
    display: block !important;
    width: 100% !important;
    background: #0d4f3d !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 0 !important;
    border-radius: 35px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    white-space: nowrap !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.evfp-picker-add:hover {
    background: #2a7b63 !important;
    color: #fff !important;
}

.evfp-picker-badge-in-cart {
    display: inline-block;
    color: var(--evfp-brand-700);
    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .evfp-frozen-picker {
        padding: 14px;
    }
    .evfp-picker-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ===================== Cart upsell ===================== */
.evfp-cart-upsell {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--evfp-brand-50);
    border: 1px solid #c8d8d0;
    border-radius: var(--evfp-radius);
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
    flex-wrap: nowrap;
}

.evfp-cart-upsell .evfp-cart-upsell-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    flex-wrap: nowrap;
}

.evfp-cart-upsell-icon {
    font-size: 20px;
    line-height: 1;
    color: var(--evfp-brand-700);
    flex-shrink: 0;
}

.evfp-cart-upsell-text {
    flex: 1;
    min-width: 0;
}

.evfp-cart-upsell-text p {
    margin: 0;
    font-size: 14px;
    color: #444;
}

.evfp-cart-upsell-btn,
button#evfp-swap-all-tablets {
    flex-shrink: 0 !important;
    background: #0d4f3d !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 35px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

.evfp-cart-upsell-btn:hover,
button#evfp-swap-all-tablets:hover {
    background: #2a7b63 !important;
    color: #fff !important;
}

/* ===================== Cart frozen warning ===================== */
.evfp-cart-frozen-warning {
    background: var(--evfp-yellow-50);
    border: 1px solid var(--evfp-yellow-500);
    border-radius: var(--evfp-radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    color: var(--evfp-yellow-900);
}

.evfp-cart-warning-text {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.evfp-cart-warning-text strong {
    color: var(--evfp-yellow-900);
}

.evfp-cart-warning-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Outline button */
.evfp-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid var(--evfp-yellow-500);
    border-radius: 6px;
    background: transparent;
    color: var(--evfp-yellow-900);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.evfp-btn-outline:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--evfp-yellow-900);
    color: var(--evfp-yellow-900);
}

/* Green filled button */
.evfp-btn-green {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 2px solid var(--evfp-green-600);
    border-radius: 6px;
    background: var(--evfp-green-600);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.evfp-btn-green:hover {
    background: var(--evfp-green-700);
    border-color: var(--evfp-green-700);
    color: #fff;
}

/* ===================== Toast ===================== */
.evfp-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--evfp-brand-900);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--evfp-radius);
    font-size: 14px;
    z-index: 1000000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    text-align: center;
}

.evfp-toast.evfp-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===================== Legacy cart notice ===================== */
.evfp-cart-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--evfp-brand-50);
    border: 1px solid var(--evfp-brand-700);
    border-radius: var(--evfp-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--evfp-brand-900);
}

.evfp-cart-notice svg {
    flex-shrink: 0;
}

/* ===================== Hidden original popup template ===================== */
#evfp-popup {
    display: none !important;
}

/* ===================== Mobile: bottom sheet ===================== */
@media (max-width: 768px) {

    /* Overlay: bottom-aligned for bottom sheet */
    #evfp-overlay {
        align-items: flex-end !important;
    }

    /* Popup: full-width bottom sheet */
    .evfp-popup-active {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 85vh;
        overflow-y: auto;
        transform: translateY(100%);
        margin: 0 !important;
    }

    #evfp-overlay.evfp-visible .evfp-popup-active {
        transform: translateY(0);
    }

    .evfp-popup-active .evfp-popup-inner {
        padding: 12px 16px 20px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
    }

    /* Drag handle */
    .evfp-popup-active .evfp-popup-inner::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #d0d0d0;
        border-radius: 2px;
        margin: 0 auto 14px;
    }

    .evfp-popup-active .evfp-popup-close {
        top: 14px;
        right: 16px;
    }

    .evfp-popup-active .evfp-popup-icon {
        width: 48px;
        height: 48px;
    }

    .evfp-popup-active .evfp-popup-icon svg {
        width: 32px;
        height: 32px;
    }

    .evfp-popup-active .evfp-popup-title {
        font-size: 17px;
    }

    .evfp-popup-active .evfp-popup-desc {
        font-size: 13px;
    }

    .evfp-popup-active .evfp-option-card {
        padding: 12px 14px;
    }

    .evfp-popup-active .evfp-option-icon {
        width: 40px;
        height: 40px;
    }

    .evfp-popup-active .evfp-option-title {
        font-size: 14px;
    }

    .evfp-popup-active .evfp-option-desc {
        font-size: 12px;
    }

    /* Extra padding on last card to avoid chat widget overlap */
    .evfp-popup-active .evfp-option-card:last-child {
        margin-bottom: 10px;
    }

    /* Primary button: tighter padding on mobile */
    .evfp-popup-active .evfp-popup-primary-btn {
        padding: 12px 14px;
        font-size: 13px;
    }

    .evfp-popup-active .evfp-popup-primary-icon {
        width: 36px;
        height: 36px;
    }

    .evfp-popup-active .evfp-popup-primary-text strong {
        font-size: 14px;
    }

    .evfp-popup-active .evfp-popup-primary-text small {
        font-size: 11px;
    }

    /* Frozen info block: tighter padding on mobile */
    .evfp-frozen-info {
        padding: 12px 14px;
        margin: 12px 0;
    }

    .evfp-tablet-recommend {
        padding: 12px 14px;
    }

    /* Cart warning: stack buttons vertically on mobile */
    .evfp-cart-warning-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .evfp-cart-warning-actions .evfp-btn-outline,
    .evfp-cart-warning-actions .evfp-btn-green {
        text-align: center;
    }

    /* Cart upsell: wrap on small screens */
    .evfp-cart-upsell {
        flex-wrap: wrap;
    }

    /* Toast: full-width on mobile */
    .evfp-toast {
        bottom: 20px;
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(20px);
        max-width: none;
    }

    .evfp-toast.evfp-toast-visible {
        transform: translateX(0) translateY(0);
    }
}
