/* ═══════════════════════════════════════════════
   Smart Product Addons — Premium Frontend CSS
   ═══════════════════════════════════════════════ */

:root {
    --spa-primary:      #7b2d8b;
    --spa-primary-dark: #5a1a6b;
    --spa-accent:       #f0a500;
    --spa-bg:           #fdfaff;
    --spa-border:       #e8d5f0;
    --spa-border-hover: #c59ad8;
    --spa-checked-bg:   #f8f0ff;
    --spa-checked-border: #9b4dbb;
    --spa-text:         #2d2d2d;
    --spa-muted:        #777;
    --spa-price-color:  #7b2d8b;
    --spa-radius:       12px;
    --spa-shadow:       0 2px 12px rgba(123,45,139,0.08);
    --spa-shadow-hover: 0 4px 20px rgba(123,45,139,0.15);
}

/* ── Wrapper ───────────────────────────────────── */
.spa-addons-wrap {
    margin: 20px 0 24px;
    font-family: inherit;
}

.spa-addons-heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--spa-primary);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spa-addons-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--spa-border), transparent);
}

.spa-addons-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Base field card ───────────────────────────── */
.spa-field {
    background: var(--spa-bg);
    border: 1.5px solid var(--spa-border);
    border-radius: var(--spa-radius);
    padding: 14px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: var(--spa-shadow);
    position: relative;
    overflow: hidden;
}

.spa-field::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--spa-primary);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.spa-field:hover {
    border-color: var(--spa-border-hover);
    box-shadow: var(--spa-shadow-hover);
}

.spa-field.spa-field--active {
    border-color: var(--spa-checked-border);
    background: var(--spa-checked-bg);
    box-shadow: var(--spa-shadow-hover);
}

.spa-field.spa-field--active::before {
    opacity: 1;
}

/* ── Checkbox field ────────────────────────────── */
.spa-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

/* Custom checkbox */
.spa-checkbox-visual {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--spa-border-hover);
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: all 0.18s ease;
}

.spa-checkbox-visual svg {
    width: 11px;
    height: 11px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.18s ease;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spa-field.spa-field--active .spa-checkbox-visual {
    background: var(--spa-primary);
    border-color: var(--spa-primary);
}

.spa-field.spa-field--active .spa-checkbox-visual svg {
    opacity: 1;
    transform: scale(1);
}

/* Hidden real checkbox */
.spa-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Text area next to checkbox */
.spa-field-text {
    flex: 1;
    min-width: 0;
}

/* ── Field title ───────────────────────────────── */
.spa-field-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--spa-text);
    margin: 0 0 2px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.4;
}

/* ── Price badge ───────────────────────────────── */
.spa-field-price {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--spa-primary), var(--spa-primary-dark));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.spa-field--active .spa-field-price {
    background: linear-gradient(135deg, #27ae60, #1e8449);
}

/* ── Subtitle ──────────────────────────────────── */
.spa-field-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--spa-muted);
    line-height: 1.5;
}

/* ── Dropdown field ────────────────────────────── */
.spa-dropdown-header {
    margin: 0 0 10px;
}

.spa-dropdown-select-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 320px;
}

.spa-dropdown-select-wrap::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--spa-primary);
    pointer-events: none;
}

.spa-dropdown {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--spa-border-hover);
    border-radius: 8px;
    font-size: 14px;
    color: var(--spa-text);
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.spa-dropdown:focus {
    outline: none;
    border-color: var(--spa-primary);
    box-shadow: 0 0 0 3px rgba(123,45,139,0.12);
}

.spa-dropdown:hover {
    border-color: var(--spa-primary);
}

/* ── Summary strip ─────────────────────────────── */
.spa-price-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #fef9e7, #fdf3d0);
    border: 1.5px solid #f0c040;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #7a5200;
    box-shadow: 0 2px 8px rgba(240,165,0,0.12);
}

.spa-summary-icon {
    font-size: 16px;
    line-height: 1;
}

.spa-summary-text {
    flex: 1;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 600px) {
    .spa-field { padding: 12px 13px; }
    .spa-dropdown-select-wrap { max-width: 100%; }
    .spa-field-title { font-size: 13px; }
}
