/* =========================================================
   W3 Service Rules — Frontend styles
   Override any variable below in your theme/Elementor.
   ========================================================= */

:root {
    --w3s-color-text:        #2b2b2b;
    --w3s-color-muted:       #6b7280;
    --w3s-color-border:      #e5e7eb;
    --w3s-color-bg:          #ffffff;
    --w3s-color-accent:      #1f7a3a;
    --w3s-color-warning-bg:  #fff8e1;
    --w3s-color-warning-fg:  #6b4f00;
    --w3s-color-error-bg:    #fdecea;
    --w3s-color-error-fg:    #8a1f11;
    --w3s-color-success-bg:  #e8f5e9;
    --w3s-color-success-fg:  #1b5e20;

    --w3s-radius:    6px;
    --w3s-gap:       10px;
    --w3s-padding:   14px;
    --w3s-font-size: 14px;
}

/* ---------- Availability badges ---------- */

/* Shared: loop grid + single product */
.w3-service-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 8px 0 6px;
}
.w3-service-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--w3s-color-text);
    line-height: 1.4;
}
.w3-service-badge__dot {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.w3-service-badge__text { flex: 1; }
.w3-service-badge--green  .w3-service-badge__dot { background: #22c55e; }
.w3-service-badge--yellow .w3-service-badge__dot { background: #f59e0b; }
.w3-service-badge--red    .w3-service-badge__dot { background: #ef4444; }
.w3-service-badge--grey   .w3-service-badge__dot { background: #9ca3af; }

/* Single product page — framed */
.w3-service-badges--single {
    gap: 7px;
    margin: 10px 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--w3s-color-border);
    border-radius: var(--w3s-radius);
    background: #f9fafb;
}

/* ---------- Trust signal groups ---------- */
.w3-service {
    margin: 14px 0;
    font-size: var(--w3s-font-size);
    color: var(--w3s-color-text);
}
.w3-service__group + .w3-service__group { margin-top: 14px; }
.w3-service__group-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}
.w3-service__items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--w3s-gap);
}
.w3-service__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--w3s-color-bg);
    border: 1px solid var(--w3s-color-border);
    border-radius: var(--w3s-radius);
    padding: 8px 12px;
    line-height: 1.4;
}
.w3-service__icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
    color: var(--w3s-color-accent);
}
.w3-service__icon[src] { width: 20px; height: 20px; }
.w3-service__text { display: inline-flex; flex-direction: column; }
.w3-service__item-title { font-weight: 600; }
.w3-service__item-short { font-size: 12px; color: var(--w3s-color-muted); }
.w3-service__item-title a,
.w3-service__item-short a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.w3-service__item-title a:hover,
.w3-service__item-short a:hover {
    color: var(--w3s-color-accent);
}

/* "i" info icon — visible cue that hovering reveals more info (native title attr). */
.w3-service__info {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    color: var(--w3s-color-muted);
    border: 1px solid currentColor;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    cursor: help;
    user-select: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.w3-service__info:hover,
.w3-service__info:focus {
    color: #fff;
    background: var(--w3s-color-accent);
    border-color: var(--w3s-color-accent);
    outline: none;
}

/* Custom tooltip that works on touch devices (tap to toggle) as well as
   desktop (hover / keyboard focus). Replaces the native `title` attribute,
   which never shows on mobile. */
.w3-service__info-wrap {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center;
    display: inline-flex;
}
.w3-service__info-wrap .w3-service__info {
    margin-left: 0;
    cursor: pointer;
}
.w3-service__tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    z-index: 50;
    width: max-content;
    max-width: 240px;
    padding: 8px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}
.w3-service__tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 6px;
    border: 6px solid transparent;
    border-top-color: #333;
}
.w3-service__info-wrap:hover .w3-service__tooltip,
.w3-service__info:focus + .w3-service__tooltip,
.w3-service__info-wrap.is-open .w3-service__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Layout variants per location (easy to override) */
.w3-service--cart .w3-service__items,
.w3-service--checkout .w3-service__items {
    flex-direction: column;
}
.w3-service--cart .w3-service__item,
.w3-service--checkout .w3-service__item {
    width: 100%;
}

/* ---------- Postcode checker ---------- */
.w3-service-postcode {
    border: 1px solid var(--w3s-color-border);
    background: var(--w3s-color-bg);
    border-radius: var(--w3s-radius);
    padding: var(--w3s-padding);
    margin: 0 0 14px;
}
.w3-service-postcode__label { display: block; font-weight: 600; margin-bottom: 8px; }
.w3-service-postcode__row   { display: flex; gap: 8px; }
.w3-service-postcode__input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--w3s-color-border);
    border-radius: var(--w3s-radius);
}
.w3-service-postcode__result { margin-top: 10px; }
.w3-service-postcode__msg {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--w3s-radius);
}
.w3-service-postcode__msg--served {
    background: var(--w3s-color-success-bg); color: var(--w3s-color-success-fg);
}
.w3-service-postcode__msg--communication_required {
    background: var(--w3s-color-warning-bg); color: var(--w3s-color-warning-fg);
}
.w3-service-postcode__msg--not_served {
    background: var(--w3s-color-error-bg); color: var(--w3s-color-error-fg);
}

/* ---------- Minimum order notice ---------- */
.w3-service-min-order {
    background: var(--w3s-color-warning-bg);
    color: var(--w3s-color-warning-fg);
    border: 1px solid #fde68a;
    padding: 10px 14px;
    border-radius: var(--w3s-radius);
    margin: 12px 0;
}

/* Standalone "Back to products" button at the top of cart/checkout. */
.w3-service-back-to-shop {
    margin: 0 0 16px;
    text-align: left;
}
.w3-service-back-to-shop__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
    background: transparent;
    color: var(--w3s-color-text);
    border: 1px solid var(--w3s-color-border);
    border-radius: var(--w3s-radius);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.w3-service-back-to-shop__btn:hover,
.w3-service-back-to-shop__btn:focus {
    background: var(--w3s-color-accent);
    border-color: var(--w3s-color-accent);
    color: #fff;
    text-decoration: none;
    outline: none;
}
.w3-service-back-to-shop__arrow {
    font-size: 16px;
    line-height: 1;
}

/* ---------- Mini cart specific ---------- */
.w3-service-mini-min-order {
    background: var(--w3s-color-warning-bg);
    color: var(--w3s-color-warning-fg);
    border: 1px solid #fde68a;
    padding: 10px 12px;
    border-radius: var(--w3s-radius);
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}
.w3-service-mini-min-order .amount,
.w3-service-mini-min-order .woocommerce-Price-amount {
    font-weight: 700;
}
/* Compact the postcode checker + trust signals when shown inside the mini cart. */
.widget_shopping_cart .w3-service-postcode,
.woocommerce-mini-cart .w3-service-postcode {
    padding: 10px;
    margin: 10px 0;
}
.widget_shopping_cart .w3-service-postcode__label,
.woocommerce-mini-cart .w3-service-postcode__label {
    font-size: 12px;
    margin-bottom: 6px;
}
.w3-service--mini_cart {
    margin: 12px 0 4px;
    font-size: 13px;
    background: #fafafa;
    border: 1px solid var(--w3s-color-border);
    border-radius: var(--w3s-radius);
    padding: 4px 12px;
}
.w3-service--mini_cart .w3-service__group + .w3-service__group {
    margin-top: 0;
}
.w3-service--mini_cart .w3-service__group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--w3s-color-muted);
    margin: 10px 0 6px;
    font-weight: 600;
}
.w3-service--mini_cart .w3-service__items {
    flex-direction: column;
    gap: 0;
}
.w3-service--mini_cart .w3-service__item {
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--w3s-color-border);
    border-radius: 0;
    align-items: flex-start;
    gap: 12px;
}
.w3-service--mini_cart .w3-service__group:last-child .w3-service__item:last-child {
    border-bottom: 0;
}
.w3-service--mini_cart .w3-service__icon {
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    color: var(--w3s-color-accent);
    margin-top: 2px;
}
.w3-service--mini_cart .w3-service__icon[src] {
    width: 24px;
    height: 24px;
}
.w3-service--mini_cart .w3-service__text {
    flex: 1;
    gap: 2px;
}
.w3-service--mini_cart .w3-service__item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--w3s-color-text);
    line-height: 1.3;
}
.w3-service--mini_cart .w3-service__item-short {
    font-size: 12px;
    color: var(--w3s-color-muted);
    line-height: 1.4;
}

/* ---------- Store-only product ---------- */
.w3-service-store-only {
    border: 1px solid #facc15;
    background: #fffbeb;
    padding: var(--w3s-padding);
    border-radius: var(--w3s-radius);
    margin: 14px 0;
}
.w3-service-store-only__label { margin: 0 0 6px; }
.w3-service-store-only__text  { margin: 0 0 10px; color: var(--w3s-color-muted); }
.w3-service-store-only__cta   { display: inline-block; }

/* ---------- Variation availability message (out-of-stock variations) ---------- */
.w3-service-variation-availability {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: var(--w3s-radius);
    background: var(--w3s-color-warning-bg);
    color: var(--w3s-color-warning-fg);
    border: 1px solid #fde68a;
    font-size: 13px;
    line-height: 1.45;
}
.w3-service-variation-availability:empty,
.w3-service-variation-availability[hidden] {
    display: none;
}
.w3-service-variation-availability a {
    color: inherit;
    text-decoration: underline;
}
