.mfb-builder {
    max-width: 480px;
    margin: 0 auto;
    font-family: inherit;
}

.mfb-preview {
    position: relative;
    width: 100%;
    max-width: 420px;      /* keep the preview from stretching too wide */
    margin: 0 auto 20px;   /* center within its column */
    aspect-ratio: 4 / 5;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
}

.mfb-preview-inner,
.mfb-preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mfb-preview-frame { z-index: 2; }
.mfb-preview-inner {
    z-index: 1;
    /* Adjust this to fit the transparent window of your frame PNGs */
    padding: 12%;
    box-sizing: border-box;
}

.mfb-step {
    margin: 16px 0 8px;
    font-size: 18px;
    font-weight: 700;
}

.mfb-frame-options,
.mfb-design-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mfb-frame-options img,
.mfb-design-options img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: border-color .15s ease;
}

.mfb-frame-options img:hover,
.mfb-design-options img:hover {
    border-color: #c7b6f2;
}

.mfb-frame-options img.mfb-active,
.mfb-design-options img.mfb-active {
    border-color: #6b3fd4;
}

.mfb-price {
    font-size: 26px;
    font-weight: 700;
    color: #6b3fd4;
    margin: 10px 0 16px;
}

.mfb-price::before { content: attr(data-currency); }

.mfb-add {
    background: #6b3fd4;
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background .15s ease;
}

.mfb-add:hover { background: #5a32b8; }
.mfb-add:disabled { opacity: .6; cursor: not-allowed; }

/* ---- Extra fields ---- */
.mfb-extra { margin: 8px 0 4px; }
.mfb-field { margin: 18px 0; }

.mfb-btn-group { display: flex; flex-wrap: wrap; gap: 10px; }
.mfb-opt-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid #e0ddd6;
    border-radius: 24px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all .15s ease;
}
/* Radio-style indicator on the left of each option (like the target design) */
.mfb-opt-btn::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #c9c4bb;
    background: #fff;
    flex: 0 0 auto;
    transition: all .15s ease;
}
/* Color swatches replace the radio dot when present */
.mfb-opt-btn.mfb-has-color::before { display: none; }
.mfb-opt-btn:hover { border-color: #b9a4ef; }
.mfb-opt-btn.mfb-active {
    border-color: #2b2b2b;
    background: #fff;
    font-weight: 600;
}
.mfb-opt-btn.mfb-active::before {
    border-color: #2b2b2b;
    background: #2b2b2b;
    box-shadow: inset 0 0 0 3px #fff;
}
.mfb-color-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.18);
    display: inline-block;
    flex: 0 0 auto;
}

.mfb-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 16px;
    font-size: 14px;
    cursor: pointer;
}

.mfb-field-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
    color: #2b2b2b;
}

.mfb-text {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9d5cd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.mfb-text:focus {
    outline: none;
    border-color: #6b3fd4;
    box-shadow: 0 0 0 3px rgba(107,63,212,.12);
}
textarea.mfb-text { min-height: 84px; resize: vertical; }

/* Customer image upload */
.mfb-file { display:block; margin-bottom:8px; }
.mfb-file-preview {
    max-width: 150px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px;
    margin-top: 6px;
}
.mfb-frame-options[style*="grid"] img,
.mfb-design-options[style*="grid"] img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

/* Thumbnail caption (name + price) */
.mfb-thumb-caption {
    text-align: center;
    font-size: 13px;
    margin-top: 4px;
    color: #444;
    line-height: 1.3;
}

.mfb-frame-options, .mfb-design-options { display: flex; flex-wrap: wrap; gap: 12px; }
.mfb-thumb { cursor: pointer; border: 2px solid transparent; border-radius: 8px; padding: 6px; width: 90px; box-sizing: border-box; text-align: center; transition: border-color .15s ease; }
.mfb-thumb:hover { border-color: #c7b6f2; }
.mfb-thumb.mfb-active { border-color: #6b3fd4; background: #f6f2fe; }
.mfb-thumb img { width: 100%; height: 90px; object-fit: contain; display: block; border: none; border-radius: 4px; }
.mfb-thumb-caption { font-size: 12px; margin-top: 6px; color: #444; line-height: 1.3; }
.mfb-frame-options[style*="grid"], .mfb-design-options[style*="grid"] { display: grid !important; }
.mfb-frame-options[style*="grid"] .mfb-thumb, .mfb-design-options[style*="grid"] .mfb-thumb { width: 100%; }
.mfb-frame-options[style*="grid"] .mfb-thumb img, .mfb-design-options[style*="grid"] .mfb-thumb img { height: auto; aspect-ratio: 1 / 1; }

.mfb-cart-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.mfb-qty { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 10px; overflow: hidden; }
.mfb-qty button { width: 40px; height: 44px; border: none; background: #f5f5f7; font-size: 20px; cursor: pointer; color: #333; }
.mfb-qty-input { width: 50px; height: 44px; border: none; text-align: center; font-size: 16px; }
.mfb-cart-row .mfb-add { flex: 1; width: auto; }

/* ============================================================
   v2 additions: category tabs, view toggle, slider mode,
   date-language checkboxes, multi-image upload gallery
   ============================================================ */

/* Section header row */
.mfb-section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.mfb-section-head .mfb-step { margin: 16px 0 8px; }

/* ---- Category tabs ---- */
.mfb-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 14px;
}
.mfb-cat-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    transition: all .15s ease;
}
.mfb-cat-tab:hover { border-color: #b9a4ef; }
.mfb-cat-tab.mfb-active {
    border-color: #6b3fd4;
    background: #6b3fd4;
    color: #fff;
    font-weight: 600;
}

/* ---- Slider (product-style carousel) ---- */
.mfb-thumb-wrap.mfb-slider {
    position: relative;
    padding: 0 34px;          /* space for arrows (reduced) */
    margin-bottom: 20px;
}
.mfb-slider-viewport {
    overflow: hidden;
    width: 100%;
    cursor: grab;
    touch-action: pan-y;
}
.mfb-slider-viewport:active { cursor: grabbing; }

/* Force flex regardless of any grid rules that targeted this element before. */
.mfb-slider-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    gap: 12px;
    will-change: transform;
    align-items: flex-start;
}
.mfb-slider-track .mfb-thumb {
    flex: 0 0 auto;           /* JS sets exact width per view */
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    padding: 3px;             /* tighter padding so images look bigger */
}
.mfb-slider-track .mfb-thumb img {
    pointer-events: none;
    width: 100%;
    height: auto;             /* natural portrait ratio */
    aspect-ratio: 3 / 4;      /* frames/designs are portrait -> larger, nicer */
    object-fit: contain;
}
.mfb-slider-track .mfb-thumb-caption {
    font-size: 12px;
    margin-top: 4px;
}

/* Arrows */
.mfb-slider-arrow {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 1px solid #e2d8f7;
    border-radius: 50%;
    background: #fff;
    color: #6b3fd4;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    z-index: 3;
    transition: background .15s ease, box-shadow .15s ease;
}
.mfb-slider-arrow:hover { background: #6b3fd4; color: #fff; }
.mfb-slider-prev { left: 0; }
.mfb-slider-next { right: 0; }

/* ---- Date of Marriage: date input (left) + Also Add (right) ---- */
.mfb-date-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}
.mfb-date-input-col { flex: 1 1 220px; min-width: 200px; }
.mfb-date-langs {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}
.mfb-alsoadd-label {
    font-weight: 700;
    font-size: 14px;
    color: #2b2b2b;
    margin-bottom: 2px;
}
.mfb-date-langs .mfb-check { margin-right: 0; }

/* ---- Multiple image upload gallery ---- */
.mfb-upload-status {
    font-size: 13px;
    color: #6b3fd4;
    margin: 6px 0;
    min-height: 16px;
}
.mfb-upload-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.mfb-upload-cell {
    position: relative;
    width: 90px;
    height: 90px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}
.mfb-upload-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mfb-upload-cell.mfb-upload-error { border-color: #e0453a; }
.mfb-upload-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mfb-upload-remove:hover { background: #e0453a; }
.mfb-upload-spin {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.6);
    font-size: 24px;
    color: #6b3fd4;
}
