/**
 * OnlyLove Bouquet Builder — premium frontend (single product page).
 */
:root { --olbb-brand: #e8899a; }

.olbb-builder {
    margin: 24px 0;
    padding: 0;
}
.olbb-builder-header h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0 0 18px;
    letter-spacing: -0.01em;
}

/* ===== Field block ===== */
.olbb-field {
    margin: 0 0 26px;
    padding: 0 0 22px;
    border-bottom: 1px solid #f0f0f0;
}
.olbb-field:last-of-type { border-bottom: none; }

.olbb-field-header { display: flex; align-items: center; margin-bottom: 12px; }
.olbb-field-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #2c2c2c;
    display: flex;
    align-items: center;
    gap: 8px;
}
.olbb-field-logo { width: 26px; height: 26px; object-fit: contain; }
.olbb-required-star { color: var(--olbb-brand); font-weight: 700; }
.olbb-field-desc { font-size: 13px; color: #777; margin: -6px 0 14px; line-height: 1.5; }

/* ===== Image Grid ===== */
.olbb-grid {
    display: grid;
    grid-template-columns: repeat(var(--olbb-cols, 3), 1fr);
    gap: 12px;
}
@media (max-width: 600px) {
    .olbb-grid { grid-template-columns: repeat(2, 1fr); }
}

.olbb-option {
    position: relative;
    cursor: pointer;
    margin: 0;
    display: block;
}
.olbb-option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.olbb-option-card {
    display: block;
    border: 2px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
    height: 100%;
}
.olbb-option:hover .olbb-option-card {
    border-color: var(--olbb-brand);
    box-shadow: 0 4px 16px rgba(232,137,154,0.18);
    transform: translateY(-2px);
}
.olbb-option-input:checked + .olbb-option-card {
    border-color: var(--olbb-brand);
    box-shadow: 0 4px 18px rgba(232,137,154,0.3);
    background: #fef8fa;
}

.olbb-option-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-color: #faf6f7;
    transition: transform 0.3s ease;
}
.olbb-option:hover .olbb-option-img { transform: scale(1.05); }
.olbb-option-img.olbb-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.olbb-option-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--olbb-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
    z-index: 3;
}
.olbb-option-input:checked + .olbb-option-card .olbb-option-check {
    opacity: 1;
    transform: scale(1);
}

.olbb-reco-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff9800;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    z-index: 3;
    letter-spacing: 0.02em;
}

.olbb-option-info { display: block; padding: 10px 10px 12px; text-align: center; }
.olbb-option-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 4px;
}
.olbb-option-price { display: block; font-size: 13px; }
.olbb-price-free { color: #2e7d32; font-weight: 700; }
.olbb-price-add { color: var(--olbb-brand); font-weight: 700; }

.olbb-option-tooltip {
    display: block;
    font-size: 11px;
    color: #999;
    padding: 0 10px 8px;
    text-align: center;
    line-height: 1.4;
}

/* ===== Dropdown ===== */
/* Force native dropdown rendering — overrides theme styles that hide/restyle selects. */
.olbb-field select.olbb-dropdown {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 46px !important;
    padding: 12px 40px 12px 14px !important;
    border: 2px solid #ececec !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #333 !important;
    background-color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    appearance: menulist !important;
    text-indent: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}
.olbb-field select.olbb-dropdown:focus {
    border-color: var(--olbb-brand) !important;
    box-shadow: 0 0 0 3px rgba(232,137,154,0.15) !important;
    outline: none !important;
}
.olbb-field select.olbb-dropdown option {
    color: #333 !important;
    background: #fff !important;
}

/* ===== Dropdown field wrapped as a card (compact PrestaShop-style) ===== */
.olbb-field-type-dropdown,
.olbb-field {
    /* fields already styled; this just tightens dropdown blocks */
}
.olbb-preview-wrap {
    margin-top: 12px;
}
.olbb-preview-img {
    max-width: 150px;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: block;
}

/* ===== Text input ===== */
.olbb-text-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ececec;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}
.olbb-text-input:focus {
    border-color: var(--olbb-brand);
    box-shadow: 0 0 0 3px rgba(232,137,154,0.15);
    outline: none;
}

/* ===== File upload ===== */
.olbb-upload-zone {
    position: relative;
    border: 2px dashed #d8d8d8;
    border-radius: 12px;
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}
.olbb-upload-zone:hover, .olbb-upload-zone.olbb-dragover {
    border-color: var(--olbb-brand);
    background: #fef8fa;
}
.olbb-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.olbb-upload-icon { font-size: 30px; display: block; margin-bottom: 8px; }
.olbb-upload-text { display: block; font-size: 14px; color: #555; font-weight: 500; }
.olbb-upload-hint { display: block; font-size: 11px; color: #aaa; margin-top: 6px; }
.olbb-upload-preview { margin-top: 12px; }
.olbb-upload-preview img { max-width: 120px; border-radius: 8px; border: 1px solid #eee; }
.olbb-upload-preview .olbb-file-name { font-size: 13px; color: var(--olbb-brand); font-weight: 600; }

/* ===== Live Total Bar ===== */
.olbb-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fef8fa 0%, #fdeef2 100%);
    border: 1.5px solid var(--olbb-brand);
    border-radius: 12px;
    padding: 16px 22px;
    margin: 20px 0;
}
.olbb-total-label { font-size: 15px; font-weight: 600; color: #555; }
.olbb-total-amount {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--olbb-brand);
    letter-spacing: -0.01em;
}
.olbb-total-amount.olbb-bump { animation: olbbBump 0.3s ease; }
@keyframes olbbBump {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}
