/* ============================================================
   DTB Product Options — Frontend (Single Product) Styles
   ============================================================ */

/* CSS custom properties are set inline via PHP from global settings */

.dtbpo-product-options {
    margin: 20px 0;
}

.dtbpo-field-group {
    margin-bottom: 24px;
}

.dtbpo-group-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #374151;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.dtbpo-field {
    margin-bottom: 18px;
    transition: opacity .2s;
}

.dtbpo-field[style*="display:none"],
.dtbpo-field[style*="display: none"] {
    margin: 0;
}

.dtbpo-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.dtbpo-required {
    color: #dc2626;
}

/* ── Radio Images ─────────────────────────────────────────────────────────── */
.dtbpo-radio-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dtbpo-ri-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    position: relative;
}

.dtbpo-ri-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.dtbpo-ri-img {
    width: 150px !important;
    height: 150px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: var(--dtbpo-ri-border, #d1d5db) !important;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    display: block;
}

.dtbpo-ri-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px !important;
    height: 40px !important;
    border-radius: 10px !important;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: var(--dtbpo-ri-border, #d1d5db) !important;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    transition: border-color .15s, background .15s;
    padding: 0 10px;
    text-align: center;
}

/* Selected state */
.dtbpo-ri-item:has(.dtbpo-ri-input:checked) .dtbpo-ri-img,
.dtbpo-ri-item.is-selected .dtbpo-ri-img {
    border-color: var(--dtbpo-ri-border-sel, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    transform: scale(1.03);
}

.dtbpo-ri-item:has(.dtbpo-ri-input:checked) .dtbpo-ri-text,
.dtbpo-ri-item.is-selected .dtbpo-ri-text {
    border-color: var(--dtbpo-ri-border-sel, #2563eb) !important;
    background: #eff6ff;
}

.dtbpo-ri-item:hover .dtbpo-ri-img {
    border-color: var(--dtbpo-ri-border-sel, #2563eb) !important;
    opacity: .9;
}

/* ── Radio Image Label (below image) ──────────────────────────────────────── */
.dtbpo-ri-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    max-width: 150px;
    line-height: 1.3;
    margin-top: 2px;
}

/* ── Radio Text ───────────────────────────────────────────────────────────── */
.dtbpo-radio-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dtbpo-rt-item {
    cursor: pointer;
}

.dtbpo-rt-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dtbpo-rt-label {
    display: inline-block;
    padding: 7px 16px;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: var(--dtbpo-rt-border, #e5e7eb) !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.dtbpo-rt-item:has(.dtbpo-rt-input:checked) .dtbpo-rt-label,
.dtbpo-rt-item.is-selected .dtbpo-rt-label {
    border-color: var(--dtbpo-rt-border-sel, #2563eb) !important;
    background: #eff6ff;
}

.dtbpo-rt-item:hover .dtbpo-rt-label {
    border-color: var(--dtbpo-rt-border-sel, #2563eb) !important;
    opacity: .85;
}

/* ── Checkbox Text ────────────────────────────────────────────────────────── */
.dtbpo-checkbox-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dtbpo-ct-item {
    cursor: pointer;
}

.dtbpo-ct-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.dtbpo-ct-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-style: solid !important;
    border-width: 2px !important;
    border-color: var(--dtbpo-rt-border, #e5e7eb) !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.dtbpo-ct-label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background .15s, border-color .15s;
}

.dtbpo-ct-item:has(.dtbpo-ct-input:checked) .dtbpo-ct-label,
.dtbpo-ct-item.is-selected .dtbpo-ct-label {
    border-color: var(--dtbpo-rt-border-sel, #2563eb) !important;
    background: #eff6ff;
}

.dtbpo-ct-item:has(.dtbpo-ct-input:checked) .dtbpo-ct-label::before,
.dtbpo-ct-item.is-selected .dtbpo-ct-label::before {
    background: var(--dtbpo-rt-border-sel, #2563eb);
    border-color: var(--dtbpo-rt-border-sel, #2563eb);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M10 3L5 8.5 2 5.5l1-1 2 2 4-4.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.dtbpo-ct-item:hover .dtbpo-ct-label {
    border-color: var(--dtbpo-rt-border-sel, #2563eb) !important;
    opacity: .85;
}

/* ── Select ───────────────────────────────────────────────────────────────── */
.dtbpo-select {
    width: 100%;
    max-width: 320px;
    padding: 9px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E") right 12px center no-repeat;
    appearance: none;
    cursor: pointer;
    transition: border-color .15s;
}
.dtbpo-select:focus {
    border-color: #374151;
    box-shadow: 0 0 0 2px rgba(55,65,81,.12);
    outline: none;
}

/* ── Text Input ───────────────────────────────────────────────────────────── */
.dtbpo-text-input {
    width: 100%;
    max-width: 320px;
    padding: 9px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    transition: border-color .15s;
}
.dtbpo-text-input:focus {
    border-color: #374151;
    box-shadow: 0 0 0 2px rgba(55,65,81,.12);
    outline: none;
}

/* ── Info Text ────────────────────────────────────────────────────────────── */
.dtbpo-info-text {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
}
.dtbpo-info-text--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 3px solid #2563eb;
    color: #1e40af;
}
.dtbpo-info-text--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 3px solid #16a34a;
    color: #166534;
}
.dtbpo-info-text--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid #d97706;
    color: #92400e;
}
.dtbpo-info-text--neutral {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    color: #475569;
}
.dtbpo-info-text--plain {
    color: #6b7280;
    padding: 4px 0;
}

/* ── Choice Price Tag ────────────────────────────────────────────────────── */
.dtbpo-choice-price-tag {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-align: center;
    margin-top: 2px;
}

/* ── Pre-cart Extras Summary ─────────────────────────────────────────────── */
.dtbpo-extras-summary {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    max-width: 320px;
}

.dtbpo-extras-list {
    margin-bottom: 10px;
}

.dtbpo-extras-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px dotted #e2e8f0;
}

.dtbpo-extras-item:last-child {
    border-bottom: none;
}

.dtbpo-extras-label {
    color: #374151;
}

.dtbpo-extras-price {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.dtbpo-extras-total {
    padding-top: 10px;
    border-top: 2px solid #e2e8f0;
    text-align: right;
    font-size: 15px;
    color: #111827;
}

/* ── Checkbox Images ─────────────────────────────────────────────────────── */
/* Reuses all .dtbpo-ri-* styles — just needs the multi-select indicator */
.dtbpo-ci-item {
    position: relative;
}
.dtbpo-ci-item.is-selected .dtbpo-ri-img {
    border-color: var(--dtbpo-ri-border-sel, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
/* Checkmark indicator on selected CI items */
.dtbpo-ci-item.is-selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--dtbpo-ri-border-sel, #2563eb);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    line-height: 1;
    padding-top: 1px;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .dtbpo-ri-img,
    .dtbpo-ri-text {
        width: 120px !important;
        height: 120px !important;
    }
    .dtbpo-ri-text {
        height: 36px !important;
    }
    .dtbpo-ri-label {
        max-width: 120px !important;
    }
}
