/**
 * REKFI — Product Page Spec Sheet Styles v2
 * Baymard scannability + Stripe-inspired precision
 * Brand: REKFI red (#dc2626) on neutral canvas
 */

/* ============================================================
   KEY SPECS — Product summary column (right side, above ATC)
   ============================================================ */
.rekfi-key-specs {
    margin: 18px 0 14px;
    padding: 0;
}

.rekfi-key-specs-title {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin: 0 0 10px 0;
}

/* ============================================================
   SPEC TABLE — Shared
   ============================================================ */
.rekfi-spec-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.rekfi-spec-table tr {
    border-bottom: 1px solid #f3f4f6;
}
.rekfi-spec-table tr:last-child {
    border-bottom: none;
}

.rekfi-spec-label {
    padding: 7px 12px 7px 14px;
    font-size: 12px;
    color: #6b7280;
    width: 38%;
    vertical-align: middle;
    font-weight: 400;
    line-height: 1.45;
    background: #fafafa;
}

.rekfi-spec-value {
    padding: 7px 14px 7px 0;
    font-size: 12.5px;
    color: #111827;
    font-weight: 500;
    line-height: 1.45;
    vertical-align: middle;
}

/* Compact variant (key specs) */
.rekfi-spec-table--compact .rekfi-spec-label {
    padding: 6px 10px 6px 12px;
    font-size: 11px;
}
.rekfi-spec-table--compact .rekfi-spec-value {
    padding: 6px 12px 6px 0;
    font-size: 12px;
}
.rekfi-spec-table--compact {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

/* "See all specs" link */
.rekfi-specs-more {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    font-size: 11.5px;
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: color 0.15s;
}
.rekfi-specs-more:hover {
    color: #b91c1c;
}

/* ============================================================
   FULL SPECS — Accordeon groups (Specifications tab)
   Supports both native elements and class-based HTML
   ============================================================ */
.rekfi-full-specs {
    margin: 0;
}

/* === Class-based (new REKFI branded specs) === */
.rekfi-specs-group {
    margin-bottom: 1px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.12s;
}
.rekfi-specs-group:hover {
    box-shadow: 0 1px 4px rgba(220,38,38,0.06);
}
.rekfi-specs-group[open] {
    box-shadow: 0 2px 8px rgba(220,38,38,0.08);
}
.rekfi-specs-group[open] > .rekfi-specs-group-title {
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    color: #991b1b;
}
.rekfi-specs-group-title {
    padding: 11px 16px;
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
    border-bottom: 1px solid transparent;
}
.rekfi-specs-group-title:hover {
    background: #f3f4f6;
}
.rekfi-specs-group-title::-webkit-details-marker { display: none; }
.rekfi-specs-group-icon {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-left: 8px;
}
.rekfi-specs-group[open] .rekfi-specs-group-icon {
    transform: rotate(180deg);
}
.rekfi-spec-table--full {
    width: 100%;
    border-collapse: collapse;
    border: none;
}
.rekfi-spec-table--full .rekfi-spec-label {
    padding: 8px 16px;
    font-size: 12.5px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.45;
    width: 35%;
    vertical-align: middle;
    white-space: nowrap;
}
.rekfi-spec-table--full .rekfi-spec-value {
    padding: 8px 0;
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    line-height: 1.45;
    vertical-align: middle;
}
.rekfi-spec-table--full tr {
    border-bottom: 1px solid #f3f4f6;
}
.rekfi-spec-table--full tr:last-child {
    border-bottom: none;
}

/* === Native element fallback (injected raw HTML) === */
.rekfi-full-specs details {
    margin-bottom: 1px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.12s;
}
.rekfi-full-specs details:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.rekfi-full-specs details[open] {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Native <summary> — header row */
.rekfi-full-specs summary {
    padding: 11px 16px;
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s;
    border-bottom: 1px solid transparent;
}
.rekfi-full-specs summary:hover {
    background: #f3f4f6;
}
.rekfi-full-specs summary::-webkit-details-marker {
    display: none;
}
/* Chevron indicator on summary */
.rekfi-full-specs summary::after {
    content: "▾";
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    margin-left: 8px;
}
.rekfi-full-specs details[open] > summary {
    background: #f3f4f6;
    border-bottom-color: #e5e7eb;
}
.rekfi-full-specs details[open] > summary::after {
    transform: rotate(180deg);
}

/* Native <table> inside specs */
.rekfi-full-specs table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}
.rekfi-full-specs tr {
    border-bottom: 1px solid #f3f4f6;
}
.rekfi-full-specs tr:last-child {
    border-bottom: none;
}

/* Label column (first td) */
.rekfi-full-specs td:first-child {
    padding: 8px 16px;
    font-size: 12.5px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.45;
    width: 35%;
    vertical-align: middle;
    white-space: nowrap;
}

/* Value column (second td) */
.rekfi-full-specs td:last-child {
    padding: 8px 0;
    font-size: 13px;
    color: #111827;
    font-weight: 500;
    line-height: 1.45;
    vertical-align: middle;
}

/* ============================================================
   DOCUMENTATION TAB
   ============================================================ */
.rekfi-documentation {
    padding: 4px 0;
}
.rekfi-documentation h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1f2937;
}
.rekfi-documentation p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 14px;
    line-height: 1.5;
}
.rekfi-doc-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: #dc2626;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.1px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.rekfi-doc-download:hover {
    background: #b91c1c;
    color: #fff;
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
    transform: translateY(-1px);
}
.rekfi-doc-download svg {
    flex-shrink: 0;
}
.rekfi-doc-download--external {
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #dc2626;
    box-shadow: none;
}
.rekfi-doc-download--external:hover {
    background: #fef2f2;
    color: #b91c1c;
    box-shadow: 0 2px 8px rgba(220,38,38,0.12);
    transform: translateY(-1px);
}

/* ============================================================
   MOBILE — Compact, pas d'espace gaspille
   ============================================================ */
@media (max-width: 768px) {
    .rekfi-key-specs {
        margin: 8px 0 6px;
    }

    .rekfi-key-specs-title {
        font-size: 10px;
        margin: 0 0 4px;
        letter-spacing: 0.5px;
    }

    .rekfi-spec-table {
        border: none;
        border-radius: 0;
    }

    .rekfi-spec-table--compact {
        border: none;
        border-radius: 0;
    }

    .rekfi-spec-label {
        display: block;
        width: 100%;
        padding: 4px 0 0;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #9ca3af;
        font-weight: 600;
        background: transparent;
        line-height: 1.3;
    }

    .rekfi-spec-value {
        display: block;
        width: 100%;
        padding: 0 0 6px;
        font-size: 13px;
    }

    .rekfi-spec-table tr {
        display: block;
    }
    .rekfi-spec-table tr:last-child .rekfi-spec-value {
        padding-bottom: 0;
    }

    .rekfi-spec-table--compact .rekfi-spec-label {
        padding: 3px 0 0;
        font-size: 10px;
    }
    .rekfi-spec-table--compact .rekfi-spec-value {
        padding: 0 0 4px;
        font-size: 12px;
    }

    .rekfi-specs-more {
        font-size: 11px;
        margin-top: 4px;
    }

    .rekfi-specs-group {
        margin-bottom: 4px;
        border-radius: 4px;
    }

    /* Mobile: native details in full-specs */
    .rekfi-full-specs details {
        margin-bottom: 2px;
        border-radius: 4px;
    }
    .rekfi-full-specs summary {
        padding: 9px 12px;
        font-size: 11px;
    }
    .rekfi-full-specs td:first-child {
        display: block;
        width: 100%;
        padding: 4px 12px 0;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #9ca3af;
        font-weight: 600;
    }
    .rekfi-full-specs td:last-child {
        display: block;
        width: 100%;
        padding: 0 12px 6px;
        font-size: 12px;
    }
    .rekfi-full-specs tr {
        display: block;
    }
    .rekfi-full-specs tr:last-child td:last-child {
        padding-bottom: 4px;
    }

    .rekfi-specs-group-title {
        padding: 9px 12px;
        font-size: 11px;
    }

    .rekfi-specs-group-body {
        padding: 0;
    }

    .rekfi-spec-table--full {
        border: none;
        border-radius: 0;
    }
    .rekfi-spec-table--full .rekfi-spec-label {
        width: 100%;
        padding: 4px 12px 0;
        background: transparent;
        font-size: 10px;
    }
    .rekfi-spec-table--full .rekfi-spec-value {
        padding: 0 12px 6px;
        width: 100%;
        font-size: 12px;
    }
    .rekfi-spec-table--full tr:last-child .rekfi-spec-value {
        padding-bottom: 4px;
    }

    .rekfi-doc-download {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 12px;
    }

    .rekfi-documentation h3 {
        font-size: 14px;
    }
    .rekfi-documentation p {
        font-size: 12px;
    }
}

@media print {
    .rekfi-specs-group {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
    .rekfi-specs-group-title {
        background: #eee;
    }
}
