/**
 * Rozen Flora Options — Frontend styles.
 * أنماط الواجهة الأمامية للخيارات (بطاقات موحّدة ومنظّمة).
 *
 * @package Rozen_Flora_Options
 */

.rfo-options {
    margin: 0 0 24px;
    padding: 20px 0 8px;
    border-top: 1px solid #ece9e6;
    border-bottom: 1px solid #ece9e6;
}

.rfo-group { margin-bottom: 24px; }
.rfo-group:last-child { margin-bottom: 0; }
.rfo-group-title {
    font-size: 14px;
    color: #722F37;
    margin: 0 0 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.rfo-option { margin-bottom: 20px; }
.rfo-option:last-child { margin-bottom: 0; }
.rfo-option-label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: #5a3f43;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.rfo-required { color: #C0392B; }
.rfo-option.rfo-error .rfo-option-label { color: #C0392B; }
.rfo-option.rfo-error { padding-inline-start: 8px; border-inline-start: 3px solid #C0392B; }

/* ---- Unified values grid (flex, wraps cleanly, aligned) ---- */
.rfo-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

/* =========================================================
 * UNIFIED SWATCH BASE — every swatch is a uniform square card.
 * بطاقة موحّدة: 52x52px مع هامش داخلي متناسق.
 * ========================================================= */
.rfo-swatch {
    position: relative;
    cursor: pointer;
    /* Unified dimensions for all swatch types */
    width: 52px;
    height: 52px;
    box-sizing: border-box;
    border: 2px solid #e0d9d4;
    background: #fff;
    padding: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.rfo-swatch:hover {
    transform: translateY( -2px );
    border-color: #b89a5a;
    box-shadow: 0 4px 12px rgba( 114, 47, 55, 0.12 );
}

/* Selected state — shared luxury treatment */
.rfo-swatch.is-selected {
    border-color: #722F37;
    box-shadow: 0 0 0 2px #722F37, 0 4px 12px rgba( 114, 47, 55, 0.22 );
}

/* Check badge — shared, top-right corner */
.rfo-check {
    position: absolute;
    top: -6px;
    inset-inline-end: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #D4AF37;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transform: scale( 0.4 );
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.25 );
}
.rfo-swatch.is-selected .rfo-check { opacity: 1; transform: scale( 1 ); }

/* =========================================================
 * COLOR swatch — the card itself holds the color (inline bg).
 * ========================================================= */
.rfo-swatch-color {
    padding: 0;
    /* Inline background-color fills the card; add a subtle inset edge */
    box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.06 );
}
.rfo-swatch-color:hover {
    box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.06 ), 0 4px 12px rgba( 114, 47, 55, 0.12 );
}
.rfo-swatch-color.is-selected {
    box-shadow: 0 0 0 2px #722F37, inset 0 0 0 2px #fff;
}
.rfo-swatch-color .rfo-check { background: #722F37; }

/* =========================================================
 * IMAGE swatch — background image fills the uniform card.
 * ========================================================= */
.rfo-swatch-image {
    padding: 0;
    background-size: cover;
    background-position: center;
    background-color: #f5ede4;
}
.rfo-swatch-image .rfo-check { background: #722F37; }

/* =========================================================
 * ICON swatch — centered glyph inside the uniform card.
 * ========================================================= */
.rfo-swatch-icon {
    flex-direction: column;
    gap: 1px;
    padding: 4px 2px;
}
.rfo-icon-glyph {
    font-size: 22px;
    line-height: 1;
}
.rfo-icon-label {
    font-size: 9px;
    color: #5a3f43;
    font-weight: 700;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rfo-swatch-icon.is-selected {
    background: #722F37;
}
.rfo-swatch-icon.is-selected .rfo-icon-label { color: #fff; }

/* =========================================================
 * TEXT swatch — button-style card, wider to fit label + price.
 * Keeps a uniform HEIGHT so it aligns with the square cards.
 * ========================================================= */
.rfo-swatch-text {
    width: auto;
    min-width: 72px;
    height: 52px;       /* same height as the square cards */
    flex-direction: column;
    gap: 1px;
    padding: 4px 14px;
    background: #fff;
}
.rfo-text-label {
    font-size: 13px;
    font-weight: 700;
    color: #2A1F22;
    line-height: 1.1;
}
.rfo-swatch-text em {
    font-style: normal;
    font-size: 11px;
    color: #b89a5a;
    font-weight: 700;
    line-height: 1;
}
.rfo-swatch-text.is-selected {
    background: linear-gradient( 180deg, #7d353f 0%, #6e2c35 100% );
}
.rfo-swatch-text.is-selected .rfo-text-label { color: #fff; }
.rfo-swatch-text.is-selected em { color: #E5C76B; }

/* =========================================================
 * TEXT INPUT — full-width text field.
 * ========================================================= */
.rfo-textinput {
    width: 100%;
    max-width: 360px;
    padding: 11px 14px;
    border: 1.5px solid #e0d9d4;
    border-radius: 10px;
    font-size: 14px;
    background: #faf7f3;
    transition: all 0.2s ease;
}
.rfo-textinput:focus {
    outline: none;
    border-color: #722F37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba( 114, 47, 55, 0.08 );
}

/* =========================================================
 * TOTAL EXTRA hint — price summary line.
 * ========================================================= */
.rfo-total-extra {
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient( 135deg, #faf6f0 0%, #f5ede4 100% );
    border: 1px dashed #D4AF37;
    border-radius: 10px;
    color: #722F37;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
}

/* =========================================================
 * Responsive — keep cards uniform on mobile.
 * ========================================================= */
@media ( max-width: 560px ) {
    .rfo-swatch {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }
    .rfo-swatch-text {
        min-width: 64px;
        height: 46px;
        padding: 3px 11px;
    }
    .rfo-text-label { font-size: 12px; }
    .rfo-icon-glyph { font-size: 20px; }
    .rfo-icon-label { font-size: 8px; }
    .rfo-values { gap: 8px; }
}
