/* WCP Fuel Pro — Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono&display=swap');

:root {
    --fp-green:     #0a6640;
    --fp-green-lt:  #e6f4ee;
    --fp-green-dk:  #085632;
    --fp-blue:      #1a73e8;
    --fp-blue-lt:   #e8f4fd;
    --fp-orange:    #e07b00;
    --fp-red:       #c0392b;
    --fp-red-lt:    #fdecea;
    --fp-gbp:       #1a3a6e;
    --fp-gbp-lt:    #e8eef8;
    --fp-text:      #1a1f2e;
    --fp-muted:     #6b7280;
    --fp-border:    #e2e5e9;
    --fp-bg:        #f6f7f8;
    --fp-white:     #ffffff;
    --fp-radius:    10px;
    --fp-shadow:    0 2px 8px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.06);
    --fp-font:      'DM Sans', sans-serif;
}

/* ── Zone bar (shown when zone is set) ── */
.wcpfp-zone-bar {
    background: var(--fp-green);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--fp-radius);
    margin-bottom: 16px;
}
.wcpfp-zone-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.wcpfp-zone-bar-icon { font-size: 18px; flex-shrink: 0; }
.wcpfp-zone-bar-info { flex: 1; font-size: 14px; font-weight: 500; }
.wcpfp-zone-bar-info strong { font-weight: 700; }
.wcpfp-postcode-display {
    font-family: 'DM Mono', monospace;
    background: rgba(255,255,255,.15);
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.wcpfp-currency-badge {
    background: rgba(255,255,255,.2);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}
.wcpfp-change-btn {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--fp-font);
    transition: background .15s;
    white-space: nowrap;
}
.wcpfp-change-btn:hover { background: rgba(255,255,255,.25); }

/* ── Gate wrapper ── */
.wcpfp-gate-wrap {
    background: var(--fp-white);
    border: 1px solid var(--fp-border);
    border-radius: var(--fp-radius);
    box-shadow: var(--fp-shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.wcpfp-gate-wrap--compact .wcpfp-gate-inner { padding: 16px; }

.wcpfp-gate-inner { padding: 32px; }

.wcpfp-gate-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--fp-border);
}
.wcpfp-gate-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--fp-text);
}
.wcpfp-gate-subtitle { color: var(--fp-muted); margin: 0; font-size: 15px; }

/* ── Form groups ── */
.wcpfp-gate-form { display: flex; flex-direction: column; gap: 20px; }
.wcpfp-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--fp-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

/* ── Country / currency toggle ── */
.wcpfp-country-toggle {
    display: flex;
    background: var(--fp-bg);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}
.wcpfp-country-btn,
.wcpfp-currency-btn,
.wcpfp-cc-currency-btn {
    flex: 1;
    padding: 11px 16px;
    border: none;
    border-radius: 6px;
    font-family: var(--fp-font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--fp-muted);
    transition: background .15s, color .15s, box-shadow .15s;
}
.wcpfp-country-btn--active,
.wcpfp-currency-btn--active,
.wcpfp-cc-currency-btn--active {
    background: var(--fp-white);
    color: var(--fp-green);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    font-weight: 600;
}

/* ── Postcode row ── */
.wcpfp-postcode-row { display: flex; gap: 10px; }
.wcpfp-input {
    flex: 1;
    border: 2px solid var(--fp-border);
    border-radius: 8px;
    padding: 13px 16px;
    font-family: 'DM Mono', monospace;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: .08em;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    color: var(--fp-text);
    background: var(--fp-white);
}
.wcpfp-input:focus {
    border-color: var(--fp-green);
    box-shadow: 0 0 0 3px rgba(10,102,64,.12);
}
.wcpfp-input--uk:focus {
    border-color: var(--fp-gbp);
    box-shadow: 0 0 0 3px rgba(26,58,110,.12);
}

/* ── Buttons ── */
.wcpfp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 8px;
    font-family: var(--fp-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}
.wcpfp-btn:active { transform: translateY(1px); }
.wcpfp-btn--primary {
    background: var(--fp-green);
    color: #fff;
    box-shadow: 0 2px 8px rgba(10,102,64,.25);
}
.wcpfp-btn--primary:hover { background: var(--fp-green-dk); }
.wcpfp-btn--primary.wcpfp-btn--uk {
    background: var(--fp-gbp);
    box-shadow: 0 2px 8px rgba(26,58,110,.25);
}
.wcpfp-btn--primary.wcpfp-btn--uk:hover { background: #122d58; }
.wcpfp-btn--secondary {
    background: var(--fp-bg);
    color: var(--fp-text);
    border: 1px solid var(--fp-border);
}
.wcpfp-btn--secondary:hover { background: #ebebeb; }
.wcpfp-btn--loading { opacity: .7; pointer-events: none; }

/* ── Cash & Carry row ── */
.wcpfp-cc-row {
    display: flex;
    align-items: center;
    gap: 16px;
}
.wcpfp-cc-divider {
    color: var(--fp-muted);
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}
.wcpfp-currency-choice {
    margin-top: 12px;
    padding: 16px;
    background: var(--fp-bg);
    border-radius: 8px;
    border: 1px solid var(--fp-border);
}

/* ── Feedback messages ── */
.wcpfp-feedback {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.wcpfp-feedback--success { background: var(--fp-green-lt); color: var(--fp-green); border: 1px solid rgba(10,102,64,.2); }
.wcpfp-feedback--error   { background: var(--fp-red-lt);   color: var(--fp-red);   border: 1px solid rgba(192,57,43,.2); }
.wcpfp-feedback--info    { background: var(--fp-blue-lt);  color: var(--fp-blue);  border: 1px solid rgba(26,115,232,.2); }

/* ── Inline badge ── */
.wcpfp-inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--fp-green);
    font-weight: 500;
}
.wcpfp-inline-change { color: var(--fp-green); text-decoration: underline; font-size: 12px; }

/* ── Spinner ── */
@keyframes wcpfp-spin { to { transform: rotate(360deg); } }
.wcpfp-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wcpfp-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

/* ── UK-mode colour overrides ── */
.wcpfp-gate-wrap.wcpfp--uk-mode .wcpfp-btn--primary { background: var(--fp-gbp); }
.wcpfp-gate-wrap.wcpfp--uk-mode .wcpfp-btn--primary:hover { background: #122d58; }
.wcpfp-gate-wrap.wcpfp--uk-mode .wcpfp-input:focus {
    border-color: var(--fp-gbp);
    box-shadow: 0 0 0 3px rgba(26,58,110,.12);
}
.wcpfp-zone-bar.wcpfp-zone-bar--uk { background: var(--fp-gbp); }

@media (max-width: 480px) {
    .wcpfp-gate-inner { padding: 20px; }
    .wcpfp-postcode-row { flex-direction: column; }
    .wcpfp-btn { width: 100%; }
    .wcpfp-cc-row { flex-direction: column; align-items: flex-start; }
}

/* ── Enquiry-only product styling ── */
.wcpfp-enquiry-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fp-muted, #6b7280);
    font-style: italic;
}
.wcpfp-quote-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 28px;
    background: var(--fp-orange, #e07b00);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}
.wcpfp-quote-btn:hover { background: #c06d00; }
.wcpfp-quote-note {
    font-size: 12px;
    color: var(--fp-muted, #6b7280);
    margin-top: 6px;
}
.wcpfp-quote-btn-loop {
    display: block;
    text-align: center;
    margin-top: 8px;
    padding: 10px 16px;
    background: var(--fp-orange, #e07b00);
    color: #fff !important;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}
.wcpfp-quote-btn-loop:hover { background: #c06d00; }

/* ── Minimum order notice ── */
.wcpfp-min-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--fp-orange-lt, #fff4e0);
    border: 1px solid rgba(224,123,0,.25);
    color: #8a5300;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: opacity .2s, max-height .2s;
}
.wcpfp-min-notice--hidden {
    display: none;
}
.wcpfp-min-notice-icon { font-size: 18px; flex-shrink: 0; }
.wcpfp-min-notice-text { flex: 1; }

/* ── No variations available in zone ── */
.wcpfp-no-variations-notice {
    background: var(--fp-red-lt, #fdecea);
    border: 1px solid rgba(192,57,43,.2);
    color: var(--fp-red, #c0392b);
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* ── Select-location prompts ── */
.wcpfp-select-location-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--fp-blue, #1a73e8);
    font-style: italic;
}
.wcpfp-no-variations-notice--select-location {
    background: var(--fp-blue-lt, #e8f4fd);
    border-color: rgba(26,115,232,.2);
    color: var(--fp-blue, #1a73e8);
}

/* ── [wcpfp_zone_products] catalog ── */
.wcpfp-zone-products-title {
    margin: 0 0 16px;
}
.wcpfp-zone-products .wcpfp-no-variations-notice {
    margin-bottom: 24px;
}
/* ── Cash & Carry collection-view notice (replaces Add to Cart) ── */
.wcpfp-collection-notice {
    background: var(--fp-blue-lt, #e8f4fd);
    border: 1px solid rgba(26,115,232,.2);
    color: var(--fp-blue, #1a73e8);
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin: 16px 0;
}
.wcpfp-collection-notice p { margin: 0; }
.wcpfp-collection-notice p + p { margin-top: 8px; }

/* ── Collection view: keep the variations table visible, hide ONLY the
      purchase block (quantity + Add to Cart). Two scopes cover both render
      paths: the body class (native single-product pages) and the wrapper
      the [wcpfp_add_to_cart] shortcode outputs. Enforcement is server-side
      (non-purchasable + add-to-cart validation) — this is display only. ── */
body.wcpfp-collection-view form.cart .woocommerce-variation-add-to-cart,
body.wcpfp-collection-view form.cart .single_add_to_cart_button,
body.wcpfp-collection-view form.cart .quantity,
.wcpfp-collection-scope form.cart .woocommerce-variation-add-to-cart,
.wcpfp-collection-scope form.cart .single_add_to_cart_button,
.wcpfp-collection-scope form.cart .quantity {
    display: none !important;
}

/* ── [wcpfp_zone_products] grid ──
   WooCommerce's loop_shop_columns is filtered while the loop renders, but
   themes with their own product grid (Avada) apply their own column widths
   and ignore it — so the layout is set here directly, scoped to this
   shortcode's wrapper so nothing else on the site is affected. */
.wcpfp-zone-products ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.wcpfp-zone-products.wcpfp-cols-1 ul.products { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.wcpfp-zone-products.wcpfp-cols-2 ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wcpfp-zone-products.wcpfp-cols-3 ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wcpfp-zone-products.wcpfp-cols-4 ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wcpfp-zone-products.wcpfp-cols-5 ul.products { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wcpfp-zone-products.wcpfp-cols-6 ul.products { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Avada adds `clearfix` to this list, whose ::before/::after carry
   content:"" — and in a grid container pseudo-elements become GRID ITEMS,
   so ::before was taking cell 1 and pushing the first product into cell 2
   (an empty gap before the first card). Removing the theme's class would
   also fix it, but the class is theme-generated markup that may be
   re-added or relied on elsewhere, so the pseudo-elements are neutralised
   here instead — scoped to this shortcode only. */
.wcpfp-zone-products ul.products::before,
.wcpfp-zone-products ul.products::after {
    content: none !important;
    display: none !important;
}

/* Neutralise the float/width/margin the theme puts on each card — grid
   handles placement and spacing instead. */
.wcpfp-zone-products ul.products > li.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
}

@media (max-width: 1024px) {
    .wcpfp-zone-products ul.products,
    .wcpfp-zone-products.wcpfp-cols-3 ul.products,
    .wcpfp-zone-products.wcpfp-cols-4 ul.products,
    .wcpfp-zone-products.wcpfp-cols-5 ul.products,
    .wcpfp-zone-products.wcpfp-cols-6 ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .wcpfp-zone-products ul.products,
    .wcpfp-zone-products.wcpfp-cols-1 ul.products,
    .wcpfp-zone-products.wcpfp-cols-2 ul.products,
    .wcpfp-zone-products.wcpfp-cols-3 ul.products,
    .wcpfp-zone-products.wcpfp-cols-4 ul.products,
    .wcpfp-zone-products.wcpfp-cols-5 ul.products,
    .wcpfp-zone-products.wcpfp-cols-6 ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

/* ── Gift card currency selector ── */
.wcpfp-gc-currency-toggle {
    margin: 0 0 18px;
}
.wcpfp-gc-currency-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
}
.wcpfp-gc-currency-btns {
    display: inline-flex;
    border: 1px solid var(--fp-green, #0a6640);
    border-radius: 8px;
    overflow: hidden;
}
.wcpfp-gc-currency-btn {
    background: #fff;
    color: var(--fp-green, #0a6640);
    border: none;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.wcpfp-gc-currency-btn + .wcpfp-gc-currency-btn {
    border-left: 1px solid var(--fp-green, #0a6640);
}
.wcpfp-gc-currency-btn--active {
    background: var(--fp-green, #0a6640);
    color: #fff;
}

/* Cross-currency conversion shown on the cart line */
.wcpfp-gc-face {
    text-decoration: line-through;
    opacity: .65;
    margin-right: 2px;
}
.wcpfp-gc-arrow { opacity: .55; margin: 0 3px; }

/* ── Physical voucher recipient postcode field ── */
.wcpfp-gc-recipient-pc-field {
    margin: 16px 0 18px;
}
.wcpfp-gc-recipient-pc-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
}
.wcpfp-gc-recipient-pc-field .required { color: #c0392b; }
.wcpfp-gc-recipient-pc-input {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    text-transform: uppercase;
}
.wcpfp-gc-recipient-pc-feedback {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    min-height: 18px;
}
.wcpfp-gc-recipient-pc-feedback.is-valid    { color: var(--fp-green, #0a6640); }
.wcpfp-gc-recipient-pc-feedback.is-error    { color: #c0392b; }
.wcpfp-gc-recipient-pc-feedback.is-checking { color: #888; }
.wcpfp-gc-recipient-pc-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

/* ── Cash & Carry page currency toggle ── */
.wcpfp-cc-currency-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    flex-wrap: wrap;
}
.wcpfp-cc-currency-label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
}
.wcpfp-cc-cur-btn {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--fp-green, #0a6640);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fp-green, #0a6640);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.wcpfp-cc-cur-btn:hover { background: rgba(10,102,64,.08); }
.wcpfp-cc-cur-btn.wcpfp-cc-cur--active {
    background: var(--fp-green, #0a6640);
    color: #fff;
}

/* ── Pence/cents price display (pump fuels) ── */
.wcpfp-cents-price { font-weight: 700; }
.wcpfp-cents-unit {
    font-size: .8em;
    font-weight: 400;
    color: #666;
}

/* ── Max-weight notice "contact us for a quote" link ── */
.wcpfp-quote-link {
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.wcpfp-quote-link:hover { opacity: .85; }

/* ── Full-screen postcode-check overlay ── */
.wcpfp-zone-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 33, .55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: wcpfp-overlay-fade .15s ease-out;
}
@keyframes wcpfp-overlay-fade { from { opacity: 0; } to { opacity: 1; } }
.wcpfp-zone-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.wcpfp-zone-overlay-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .01em;
}
/* Large spinner — same design as the button spinner, scaled up */
.wcpfp-spinner--large {
    width: 56px;
    height: 56px;
    border-width: 5px;
    border-color: rgba(255,255,255,.3);
    border-top-color: #fff;
    margin: 0;
}
