/* =============================================================
   Riemenlabel Bundel v1.4.0 – Frontend Stylesheet
   ============================================================= */

:root {
    --rlb-accent:      #F27A1A;
    --rlb-accent-dark: #d9660e;
    --rlb-bg:          #F6F1EA;
    --rlb-white:       #ffffff;
    --rlb-text:        #1a1a1a;
    --rlb-muted:       #6b6b6b;
    --rlb-success:     #1e7e34;
    --rlb-radius:      10px;
    --rlb-shadow:      0 4px 18px rgba(0,0,0,.10);
    --rlb-tr:          .2s ease;
}

/* ---------------------------------------------------------------
   Utility
--------------------------------------------------------------- */
.rlb-hidden { display: none !important; }

/* ---------------------------------------------------------------
   Shared buttons
--------------------------------------------------------------- */
.rlb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem 1.3rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .9rem;
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background var(--rlb-tr), color var(--rlb-tr), transform var(--rlb-tr);
    white-space: nowrap;
    line-height: 1.3;
}
.rlb-btn:focus-visible { outline: 3px solid var(--rlb-accent); outline-offset: 2px; }
.rlb-btn:hover         { transform: translateY(-1px); }

.rlb-btn--accent              { background: var(--rlb-accent); color: var(--rlb-white); border-color: var(--rlb-accent); }
.rlb-btn--accent:hover        { background: var(--rlb-accent-dark); border-color: var(--rlb-accent-dark); color: var(--rlb-white); }
.rlb-btn--white               { background: var(--rlb-white); color: var(--rlb-accent); border-color: var(--rlb-white); }
.rlb-btn--white:hover         { background: var(--rlb-bg); color: var(--rlb-accent); }

/* ---------------------------------------------------------------
   Cart banner (above cart table, fragment-updated)
--------------------------------------------------------------- */
.rlb-cart-banner { margin-bottom: 1.4rem; }

.rlb-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-radius: var(--rlb-radius);
    box-shadow: var(--rlb-shadow);
    flex-wrap: wrap;
}
.rlb-banner--upsell   { background: var(--rlb-accent); color: var(--rlb-white); }
.rlb-banner--eligible { background: #1a1a2e;            color: var(--rlb-white); }
.rlb-banner--done     { background: var(--rlb-success); color: var(--rlb-white); }

.rlb-banner__text {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
}
.rlb-banner__text small { font-weight: 400; font-size: .82rem; opacity: .85; margin-top: .15rem; }

/* ---------------------------------------------------------------
   Progress bar
--------------------------------------------------------------- */
.rlb-progress-bar-wrap   { margin-bottom: 1.2rem; }
.rlb-progress-bar__label { font-size: .875rem; font-weight: 600; color: var(--rlb-text); margin: 0 0 .4rem; }
.rlb-progress-bar__label--done { color: var(--rlb-success); }
.rlb-progress-bar        { width: 100%; height: 8px; background: #e0d9d0; border-radius: 99px; overflow: hidden; }
.rlb-progress-bar__fill  { height: 100%; background: var(--rlb-accent); border-radius: 99px; transition: width .5s ease; }

/* ---------------------------------------------------------------
   Mini-cart notice (plugin's own notice above WC buttons)
--------------------------------------------------------------- */
.rlb-mini-notice {
    display: block;
    background: var(--rlb-bg);
    color: var(--rlb-text);
    font-size: .82rem;
    font-weight: 600;
    padding: .5rem .8rem;
    border-radius: 6px;
    border-left: 3px solid var(--rlb-accent);
    margin-bottom: .75rem;
}
.rlb-mini-notice--empty,
.rlb-mini-notice:empty { display: none; }

/* ---------------------------------------------------------------
   FOUT 2 — Mini-cart layout
   Scoped entirely inside the plugin's own .rlb-minicart-scope wrapper
   OR under the standard WC widget wrapper.

   Spec requirements (from brief):
   – item: flex, align-items:flex-start, gap:10px
   – image: max-width:42px, max-height:42px, object-fit:contain
   – title: font-size:12px, line-height:1.2, max 2 lines, ellipsis
   – price/qty: font-size:12px, white-space:nowrap
   – remove ×: right-aligned, fixed width, no overlap
   – subtotal: clear:both, font-size:13px, margin-top:10px
   – buttons: full width, stacked on mobile

   All selectors prefixed with .widget_shopping_cart_content
   to avoid leaking into main cart page or other themes.
--------------------------------------------------------------- */

/* Container */
.widget_shopping_cart_content .woocommerce-mini-cart {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ── Each line item ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #ece8e1;
    position: relative;
    box-sizing: border-box;
}
.widget_shopping_cart_content .woocommerce-mini-cart-item:last-child {
    border-bottom: none;
}

/* ── Product image: max 42×42, never oversized ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item img {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    max-height: 42px !important;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    display: block;
    margin: 0 !important;
}

/* ── Text wrapper (title + qty/price) ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item .rlb-item-body,
.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove_from_cart_button) {
    flex: 1 1 auto;
    min-width: 0; /* allow text truncation */
    display: block;
}

/* ── Product title: max 2 lines, ellipsis ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove_from_cart_button) {
    font-size: 12px !important;
    line-height: 1.2 !important;
    font-weight: 600;
    color: var(--rlb-text, #1a1a1a);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    max-height: calc(12px * 1.2 * 2); /* 2 lines */
    margin-bottom: 2px;
}

/* ── Quantity × price ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item .quantity {
    display: block;
    font-size: 12px !important;
    line-height: 1.3;
    color: var(--rlb-muted, #6b6b6b);
    white-space: nowrap;
    margin-top: 2px;
}

/* ── Price amounts ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item .amount,
.widget_shopping_cart_content .woocommerce-mini-cart-item .woocommerce-Price-amount {
    font-size: 12px !important;
    white-space: nowrap;
}

/* ── Free-riem badge ── */
.widget_shopping_cart_content .rlb-free-badge {
    display: inline-block;
    background: var(--rlb-accent, #F27A1A);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 2px;
    white-space: nowrap;
}

/* ── Remove button: right-aligned, never overlaps content ── */
.widget_shopping_cart_content .woocommerce-mini-cart-item .remove_from_cart_button {
    flex-shrink: 0;
    width: 20px;
    min-width: 20px;
    align-self: flex-start;
    text-align: center;
    line-height: 1;
    font-size: 14px;
    color: var(--rlb-muted, #6b6b6b);
    text-decoration: none;
    margin-top: 2px;
    /* reset any absolute positioning the theme may have set */
    position: static !important;
    top: auto !important;
    right: auto !important;
    float: none !important;
}
.widget_shopping_cart_content .woocommerce-mini-cart-item .remove_from_cart_button:hover {
    color: #c0392b;
}

/* ── Subtotal: clear, no overlap, proper spacing ── */
.widget_shopping_cart_content .woocommerce-mini-cart__total {
    clear: both;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 6px;
    margin-top: 10px;
    border-top: 2px solid #ece8e1;
    font-size: 13px !important;
    font-weight: 700;
    gap: 6px;
}
.widget_shopping_cart_content .woocommerce-mini-cart__total strong {
    font-weight: 700;
}
.widget_shopping_cart_content .woocommerce-mini-cart__total .amount {
    font-size: 13px !important;
    white-space: nowrap;
}

/* ── Buttons container: stacked column ── */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a,
.widget_shopping_cart_content .woocommerce-mini-cart__buttons .button {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
    text-align: center;
    padding: 9px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    line-height: 1.3;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

/* "Bekijk winkelwagen" */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons .wc-forward:not(.checkout) {
    background: transparent;
    color: var(--rlb-accent, #F27A1A);
    border: 2px solid var(--rlb-accent, #F27A1A);
}
.widget_shopping_cart_content .woocommerce-mini-cart__buttons .wc-forward:not(.checkout):hover {
    background: var(--rlb-accent, #F27A1A);
    color: #fff;
}

/* "Afrekenen" */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons .checkout {
    background: var(--rlb-accent, #F27A1A);
    color: #fff;
    border: 2px solid var(--rlb-accent, #F27A1A);
}
.widget_shopping_cart_content .woocommerce-mini-cart__buttons .checkout:hover {
    background: var(--rlb-accent-dark, #d9660e);
    border-color: var(--rlb-accent-dark, #d9660e);
}

/* ---------------------------------------------------------------
   Sticky footer banner
   Rendered with .rlb-hidden by PHP; JS removes it when paidBelts === 1
--------------------------------------------------------------- */
.rlb-sticky-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: #1a1a2e;
    color: var(--rlb-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: .8rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,.2);
    flex-wrap: wrap;
}
.rlb-sticky-banner.rlb-hidden { display: none !important; }

.rlb-sticky-banner__text  { font-weight: 600; font-size: .95rem; }
.rlb-sticky-banner__close {
    background: transparent;
    border: none;
    color: var(--rlb-white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
    margin-left: auto;
    opacity: .7;
    transition: opacity var(--rlb-tr);
}
.rlb-sticky-banner__close:hover { opacity: 1; }

/* ---------------------------------------------------------------
   Popup overlay
--------------------------------------------------------------- */
.rlb-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    animation: rlbFadeIn .2s ease;
}

@keyframes rlbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.rlb-popup {
    background: var(--rlb-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    padding: 2rem;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: rlbSlideUp .25s ease;
}

@keyframes rlbSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.rlb-popup__close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 1.2rem;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    color: var(--rlb-text);
    transition: background var(--rlb-tr);
}
.rlb-popup__close:hover { background: #e0e0e0; }

.rlb-popup__title    { font-size: 1.5rem; font-weight: 800; margin: 0 0 .3rem; color: var(--rlb-text); }
.rlb-popup__subtitle { color: var(--rlb-muted); font-size: .9rem; margin: 0 0 1.5rem; }

/* ---------------------------------------------------------------
   Popup product grid
--------------------------------------------------------------- */
.rlb-popup__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
}

.rlb-popup__loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--rlb-muted);
    padding: 2.5rem 1rem;
    font-size: .9rem;
}

.rlb-error {
    grid-column: 1 / -1;
    color: #c0392b;
    text-align: center;
    padding: 1.5rem;
}

.rlb-product-card {
    background: var(--rlb-bg);
    border-radius: var(--rlb-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: box-shadow var(--rlb-tr), transform var(--rlb-tr);
}
.rlb-product-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.12); transform: translateY(-2px); }

.rlb-product-card__image { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }

.rlb-product-card__body {
    padding: .75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: .5rem;
}

.rlb-product-card__name {
    font-weight: 600;
    font-size: .85rem;
    color: var(--rlb-text);
    line-height: 1.3;
}

.rlb-product-card__btn { width: 100%; margin-top: auto; }
.rlb-product-card__btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------
   Popup success state
--------------------------------------------------------------- */
.rlb-popup__success {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}
.rlb-popup__success-icon { font-size: 3rem; line-height: 1; }
.rlb-popup__success h3   { font-size: 1.4rem; font-weight: 800; margin: 0; color: var(--rlb-text); }
.rlb-popup__success p    { color: var(--rlb-muted); font-size: .9rem; margin: 0; }

/* "Ga naar winkelwagen" link in success state */
.rlb-success-cart-link   { margin-top: .8rem; min-width: 200px; }

/* ---------------------------------------------------------------
   Checkout / cart blokkade notice  (.rlb-notice)
   Rendered inside a WooCommerce wc_notice (type=error) so it sits
   inside .woocommerce-error > li. We override only our own children.
   No global selectors — fully scoped to .rlb-notice.
--------------------------------------------------------------- */
.rlb-notice {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    /* reset any inherited list-item icon the theme adds */
    background: none;
    padding: 0;
}

/* Title line */
.rlb-notice__title {
    display: block;
    font-size: 1rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.3;
}

/* Body text */
.rlb-notice__body {
    display: block;
    font-size: .88rem;
    font-weight: 400;
    color: #3a3a3a;
    line-height: 1.45;
}

/* CTA button — looks like our accent button but inside a notice */
.rlb-notice__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: .3rem;
    padding: .55rem 1.4rem;
    background: var(--rlb-accent, #F27A1A);
    color: #fff !important;          /* override WC error link colour */
    border: 2px solid var(--rlb-accent, #F27A1A);
    border-radius: 50px;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none !important;
    letter-spacing: .02em;
    cursor: pointer;
    width: fit-content;
    transition: background .2s ease, border-color .2s ease;
}
.rlb-notice__btn:hover,
.rlb-notice__btn:focus {
    background: var(--rlb-accent-dark, #d9660e);
    border-color: var(--rlb-accent-dark, #d9660e);
    color: #fff !important;
}

/* Storefront / many themes set  .woocommerce-error a  to a specific colour.
   The !important on colour above handles that. Also remove underline. */
.woocommerce-error .rlb-notice__btn,
.woocommerce-notices-wrapper .rlb-notice__btn {
    text-decoration: none !important;
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 600px) {
    .rlb-banner         { flex-direction: column; text-align: center; }
    .rlb-sticky-banner  { flex-direction: column; gap: .5rem; padding: .75rem 1rem; }
    .rlb-popup          { padding: 1.2rem; }
    .rlb-popup__grid    { grid-template-columns: repeat(2, 1fr); gap: .8rem; }

    /* Mini-cart: full-width buttons on mobile */
    .widget_shopping_cart_content .woocommerce-mini-cart__buttons {
        flex-direction: column;
    }
    .widget_shopping_cart_content .woocommerce-mini-cart__buttons a,
    .widget_shopping_cart_content .woocommerce-mini-cart__buttons .button {
        width: 100% !important;
        font-size: 12px;
    }
}
