/* Ravn Affiliate – Public CSS (base layer) */
/* Dynamic styling is generated by Ravn_Styling::generate_css() and output inline */

/* ── Reset / Base ── */
.ravn-product-box *,
.ravn-popup-inner * {
    box-sizing: border-box;
}

/* ── Product box ── */
.ravn-product-box {
    font-family: var(--ravn-font, inherit);
    background: var(--ravn-bg, #fff);
    color: var(--ravn-text, #333);
    border-radius: var(--ravn-radius, 4px);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s ease;
}

/* ── Product label ── */
.ravn-product-label {
    position: absolute;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
}

.ravn-product-label.top-left     { top: 10px;  left: 10px;  }
.ravn-product-label.top-right    { top: 10px;  right: 10px; }
.ravn-product-label.bottom-left  { bottom: 10px; left: 10px;  }
.ravn-product-label.bottom-right { bottom: 10px; right: 10px; }

/* ── Product image ── */
.ravn-product-image {
    display: block;
    width: 100%;
    text-align: center;
    overflow: hidden;
}

.ravn-product-image img {
    display: block;
    margin: 0 auto;
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

/* ── Product body ── */
.ravn-product-body {
    padding: var(--ravn-padding, 16px);
}

.ravn-product-title {
    margin: 0 0 8px;
    line-height: 1.3;
}

.ravn-product-description {
    margin: 0 0 12px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

/* ── Stars ── */
.ravn-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
    margin-bottom: 8px;
}

.ravn-stars .ravn-star,
.ravn-stars .ravn-star-half,
.ravn-stars .ravn-star-empty {
    display: inline-block;
    width: 1em;
    height: 1em;
}

.ravn-stars .ravn-star svg,
.ravn-stars .ravn-star-half svg,
.ravn-stars .ravn-star-empty svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ravn-review-count {
    font-size: 0.85em;
    color: #888;
    margin-left: 4px;
}

/* ── Updated ── */
.ravn-updated {
    font-size: 0.8em;
    color: #999;
    margin-top: 8px;
}

/* ── Sellers table ── */
.ravn-sellers {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.ravn-seller-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--ravn-seller-padding, 8px);
}

.ravn-seller-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ravn-seller-logo img {
    display: block;
    object-fit: contain;
}

.ravn-seller-info {
    flex: 1;
    min-width: 0;
}

.ravn-seller-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ravn-seller-description {
    font-size: 0.85em;
    color: #666;
}

.ravn-seller-price-col {
    flex-shrink: 0;
    text-align: right;
    font-weight: bold;
}

.ravn-seller-cta-col {
    flex-shrink: 0;
}

/* Divider */
.ravn-seller-divider {
    border: none;
    height: var(--ravn-divider-width, 1px);
    background: var(--ravn-divider-color, #eee);
    margin: 0;
}

/* Stock icons */
.ravn-stock-icon {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.85em;
}

.ravn-stock-icon.in-stock    { color: #00a32a; }
.ravn-stock-icon.out-of-stock{ color: #b32d2e; }
.ravn-stock-icon.unknown     { color: #888;    }

/* CTA button */
.ravn-cta-btn {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

/* Show all sellers */
.ravn-show-all-btn {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 0 0;
    font-size: inherit;
    font-family: inherit;
}

/* ── Popup ── */
/* Zichtbaarheid wordt bepaald door het hidden-attribuut, dat de PHP op de
   overlay zet en de JS weghaalt bij openen. Zo is er één consistente bron
   voor het tonen/verbergen (de dynamisch gegenereerde CSS doet hetzelfde). */
.ravn-popup-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999998;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ravn-popup-overlay[hidden] {
    display: none;
}

.ravn-popup-inner {
    background: var(--ravn-popup-bg, #fff);
    border-radius: var(--ravn-popup-radius, 6px);
    max-width: var(--ravn-popup-max-width, 680px);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 999999;
    padding: 24px;
    animation: apPopupIn 0.2s ease;
}

@keyframes apPopupIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.ravn-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--ravn-popup-close, #666);
    padding: 0;
    z-index: 1;
}

.ravn-popup-close:hover {
    color: #000;
}

/* ── Carousel ── */
.ravn-carousel-wrap {
    position: relative;
    overflow: hidden;
}

.ravn-carousel-track {
    display: flex;
    transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.ravn-carousel-track .ravn-product-box {
    flex-shrink: 0;
    /* Breedte per slide o.b.v. data-per-view; --ravn-per-view wordt hieronder
       gezet via de data-attribute selector zodat dit zonder inline JS werkt. */
    width: calc(100% / var(--ravn-per-view, 3));
}

.ravn-carousel-wrap[data-per-view="1"] .ravn-product-box { --ravn-per-view: 1; }
.ravn-carousel-wrap[data-per-view="2"] .ravn-product-box { --ravn-per-view: 2; }
.ravn-carousel-wrap[data-per-view="3"] .ravn-product-box { --ravn-per-view: 3; }
.ravn-carousel-wrap[data-per-view="4"] .ravn-product-box { --ravn-per-view: 4; }
.ravn-carousel-wrap[data-per-view="5"] .ravn-product-box { --ravn-per-view: 5; }
.ravn-carousel-wrap[data-per-view="6"] .ravn-product-box { --ravn-per-view: 6; }

@media (max-width: 768px) {
    .ravn-carousel-track .ravn-product-box { width: calc(100% / min(var(--ravn-per-view, 3), 2)); }
}

@media (max-width: 480px) {
    .ravn-carousel-track .ravn-product-box { width: 100%; }
}

.ravn-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ravn-arrow-bg, rgba(0,0,0,0.5));
    color: var(--ravn-arrow-color, #fff);
    border: none;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 3px;
    z-index: 5;
    transition: background 0.15s;
}

.ravn-carousel-arrow:hover { background: rgba(0,0,0,0.75); }
.ravn-carousel-arrow.prev  { left: 4px; }
.ravn-carousel-arrow.next  { right: 4px; }

.ravn-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 0;
}

.ravn-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ravn-dot-color, #ccc);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.ravn-carousel-dot.active {
    background: var(--ravn-dot-active, #333);
}

/* ── Product list (columns) ── */
.ravn-product-list {
    display: grid;
    gap: var(--ravn-cols-gap, 20px);
    grid-template-columns: repeat(var(--ravn-cols, 3), 1fr);
}

@media (max-width: 768px) {
    .ravn-product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ravn-product-list {
        grid-template-columns: 1fr;
    }
}

/* ── FAQ accordion ── */
.ravn-faq {
    margin: 16px 0;
}

.ravn-faq-item {
    border-bottom: 1px solid #eee;
}

.ravn-faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 14px 36px 14px 0;
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    display: block;
    font-weight: 600;
    color: inherit;
}

.ravn-faq-question::after {
    content: '+';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    font-weight: 300;
    transition: transform 0.2s;
}

.ravn-faq-question[aria-expanded="true"]::after {
    content: '−';
}

/* Zichtbaarheid loopt via het hidden-attribuut (gezet door PHP, geschakeld
   door de JS), niet via een .open-klasse — anders zou max-height:0 het
   antwoord alsnog verbergen zodra hidden verwijderd is. */
.ravn-faq-answer {
    padding: 0 0 14px;
}

.ravn-faq-answer[hidden] {
    display: none;
}

/* ── TOC ── */
.ravn-toc {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 14px 18px;
    display: inline-block;
    min-width: 200px;
    max-width: 100%;
    margin: 16px 0;
}

.ravn-toc-title {
    font-weight: 700;
    margin: 0 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.ravn-toc-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    color: #555;
    padding: 0 0 0 10px;
}

.ravn-toc-list {
    margin: 0;
    padding-left: 18px;
}

.ravn-toc-list li {
    padding: 2px 0;
}

.ravn-toc-list a {
    text-decoration: none;
    color: inherit;
}

.ravn-toc-list a:hover {
    text-decoration: underline;
}

.ravn-toc-list ol {
    padding-left: 16px;
    margin: 2px 0;
}

/* De PHP verbergt de inhoud met het hidden-attribuut op .ravn-toc-content;
   de JS schakelt datzelfde attribuut. */
.ravn-toc-content[hidden] {
    display: none;
}
