/* ================================================
   Smartflows v7.0 — Premium UI
   ================================================ */

* { box-sizing: border-box; }

#wcfps-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0 0 28px;
    width: 100%;
}

.wcfps-notice {
    padding: 12px 16px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff5f5;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 16px;
}

.wcfps-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .10em !important;
    text-transform: uppercase !important;
    color: #9ca3af !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    line-height: 1 !important;
}

/* ════════════════════════════════
   GRID
════════════════════════════════ */
/* ════════════════════════════════════════
   GRID LAYOUT — v17 style 2-col equal grid
════════════════════════════════════════ */
.wcfps-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

@media (max-width: 600px) {
    .wcfps-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════
   CARD — matches attached design
   [ ☐ | 🖼 | Name × 1  -1+  ৳750 ]
════════════════════════════════ */
.wcfps-card {
    position: relative;
    background: #fff;
    border: 1.5px solid #e9ebee;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    box-sizing: border-box;
}

.wcfps-card:hover {
    border-color: #b2edd8;
}

.wcfps-card.wcfps-on {
    border-color: #1D9E75;
    box-shadow: 0 0 0 3px rgba(29,158,117,.09);
}

/* ── Ribbon — top right pill ── */
.wcfps-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #fff;
    padding: 4px 10px 4px 10px;
    border-radius: 0 8px 0 8px;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
}

/* ── Card main row ── */
.wcfps-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Checkbox ── */
.wcfps-chk {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all .15s;
    align-self: flex-start;
    margin-top: 2px;
}

.wcfps-tick {
    width: 9px;
    height: 7px;
    opacity: 0;
    transition: opacity .12s;
}

.wcfps-card.wcfps-on .wcfps-chk {
    background: #1D9E75;
    border-color: #1D9E75;
}

.wcfps-card.wcfps-on .wcfps-tick { opacity: 1; }

/* ── Thumbnail ── */
.wcfps-thumb {
    width: 54px !important;
    height: 54px !important;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
    display: block;
    background: #f4f5f6;
}

/* ── Info area ── */
.wcfps-info {
    flex: 1;
    min-width: 0;
}

.wcfps-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.wcfps-qty-badge {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

/* ── Bottom row: qty controls + price ── */
.wcfps-bottom-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Quantity control ── */
.wcfps-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 7px;
    overflow: hidden;
    background: #f9fafb;
    flex-shrink: 0;
}

.wcfps-qty-ctrl button {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    width: 28px !important;
    height: 26px !important;
    min-height: unset !important;
    cursor: pointer;
    color: #6b7280 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 0 !important;
    transition: background .1s, color .1s !important;
    flex-shrink: 0;
}

.wcfps-qty-ctrl button:hover {
    background: #ecfdf5 !important;
    color: #1D9E75 !important;
}

.wcfps-qty-ctrl button svg { width: 9px; height: 9px; color: currentColor; }

.wcfps-qty-val {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    height: 26px;
    line-height: 26px;
    display: inline-block;
}

/* ── Price ── */
.wcfps-price {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    margin-left: auto;
}

/* ── Variation selects ── */
.wcfps-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.wcfps-var-select {
    font-size: 11px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 8px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    transition: border-color .15s;
}

.wcfps-var-select:focus {
    border-color: #1D9E75;
    outline: none;
}

/* ── Error ── */
.wcfps-error {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 500;
}

/* ════════════════════════════════
   ORDER SUMMARY RIGHT COLUMN
════════════════════════════════ */
#wcfps-order-summary-col {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.wcfps-sum-box {
    background: #fff;
    border: 1.5px solid #e9ebee;
    border-radius: 12px;
    overflow: hidden;
}

.wcfps-sum-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}

.wcfps-sum-head {
    display: flex;
    justify-content: space-between;
    padding: 7px 18px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #9ca3af;
    background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
}

#wcfps-sum-items { padding: 4px 0; }

.wcfps-sum-empty {
    padding: 20px 18px;
    font-size: 13px;
    color: #c4c9d4;
    font-style: italic;
    text-align: center;
}

.wcfps-sum-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid #f8f9fa;
}

.wcfps-sum-item-img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.wcfps-sum-item-info { flex: 1; min-width: 0; }

.wcfps-sum-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcfps-sum-item-qty {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.wcfps-sum-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    flex-shrink: 0;
}

/* Totals */
.wcfps-sum-totals {
    padding: 10px 18px 14px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.wcfps-sum-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #6b7280;
}

.wcfps-sum-row span:last-child { font-weight: 500; color: #374151; }

.wcfps-sum-grand {
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1.5px solid #e5e7eb;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

.wcfps-sum-grand span:last-child {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #1D9E75 !important;
}

/* ════════════════════════════════
   BILLING FORM PREMIUM STYLING
════════════════════════════════ */
.woocommerce-billing-fields h3,
#customer_information_heading,
#billing_fields_heading,
.wcf-shipping-methods-title,
.wcf-payment-option-heading h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 14px !important;
    padding-bottom: 10px !important;
    border-bottom: 1.5px solid #f0f0f0 !important;
}

/* Form fields tighter */
.wcf-customer-info-main-wrapper .form-row,
.woocommerce-billing-fields__field-wrapper .form-row {
    margin-bottom: 10px !important;
    padding: 0 !important;
}

.wcf-customer-info-main-wrapper label,
.woocommerce-billing-fields label {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
}

.wcf-customer-info-main-wrapper input[type=text],
.wcf-customer-info-main-wrapper input[type=tel],
.wcf-customer-info-main-wrapper input[type=email],
.woocommerce-billing-fields input[type=text],
.woocommerce-billing-fields input[type=tel],
.woocommerce-billing-fields input[type=email] {
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
    color: #111827 !important;
    width: 100% !important;
    transition: border-color .15s !important;
    background: #fff !important;
}

.wcf-customer-info-main-wrapper input:focus,
.woocommerce-billing-fields input:focus {
    border-color: #1D9E75 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(29,158,117,.08) !important;
}

/* Shipping options */
.wcf-shipping-method-options .woocommerce-shipping-methods li {
    background: #fff !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 11px 14px !important;
    margin-bottom: 6px !important;
    transition: border-color .15s !important;
    display: flex !important;
    align-items: center !important;
}

.wcf-shipping-method-options .woocommerce-shipping-methods li:has(input:checked) {
    border-color: #1D9E75 !important;
    background: #f0fdf8 !important;
}

.wcf-shipping-method-options label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
}

/* Payment section */
.wc_payment_method label {
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #374151 !important;
}

.payment_box {
    background: #f9fafb !important;
    border-radius: 0 0 8px 8px !important;
    font-size: 13px !important;
    color: #6b7280 !important;
}

/* Place Order button */
#place_order {
    background: #1D9E75 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 14px 24px !important;
    width: 100% !important;
    letter-spacing: .02em !important;
    color: #fff !important;
    /* cursor and pointer-events managed by JS */
    transition: background .15s, opacity .2s !important;
}

#place_order:hover { background: #15876a !important; }

/* ════════════════════════════════
   LOADING
════════════════════════════════ */
#wcfps-wrap.wcfps-loading {
    opacity: .5;
    pointer-events: none;
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 600px) {
    .wcfps-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .wcfps-qty-ctrl button { width:30px !important; height:28px !important; }
    .wcfps-qty-val { min-width:30px; height:28px; line-height:28px; }
}

/* ── Payment section inside order summary col ── */
#wcfps-order-summary-col .wcf-payment-option-heading {
    margin-top: 16px !important;
}

#wcfps-order-summary-col .wcf-payment-option-heading h3 {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

#wcfps-order-summary-col #payment {
    border-radius: 10px !important;
    overflow: hidden !important;
}

#wcfps-order-summary-col .place-order {
    padding: 0 !important;
    margin-top: 12px !important;
}

/* ════════════════════════════════════════
   SMARTFLOWS — ATTRIBUTE UI
════════════════════════════════════════ */

/* Collapsed by default — slides open when card selected */
.wcfps-attrs {
    border-top: 1px solid #f0f0f0;
    margin-top: 0;
    padding-top: 0;
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: max-height .28s ease, padding-top .28s ease, margin-top .28s ease;
}

/* When card is selected — expand */
.wcfps-card.wcfps-on .wcfps-attrs {
    max-height: 600px;
    padding-top: 12px;
    margin-top: 12px;
}

.wcfps-attr-group {}

.wcfps-attr-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6b7280;
    margin-bottom: 8px;
}

/* ── Color grid ── */
.wcfps-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.wcfps-color-opt {
    width: 52px;
    height: 52px;
    border-radius: 0;          /* no border-radius on images */
    border: 2px solid transparent;
    overflow: visible;
    cursor: pointer;
    transition: transform .12s, border-color .12s;
    position: relative;
    flex-shrink: 0;
}

.wcfps-color-opt > img {
    width: 100%;
    height: 100%;
    border-radius: 0;          /* no border-radius */
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.wcfps-color-opt > .wcfps-swatch-circle {
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: block;
}

/* ── Active: premium green tick badge, no hover border ── */
.wcfps-color-opt.sf-selected {
    border-color: #1D9E75;
    outline: 2px solid #1D9E75;
    outline-offset: 1px;
}

.wcfps-color-opt.sf-selected::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: #1D9E75;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    z-index: 3;
}

.wcfps-color-opt.sf-selected::before {
    content: '✓';
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    z-index: 4;
    line-height: 1;
}

.wcfps-swatch-circle {
    width: 100%;
    height: 100%;
    display: block;
}

.wcfps-swatch-text {
    font-size: 9px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    padding: 2px;
    line-height: 1.2;
}

/* ── Radio group ── */
.wcfps-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wcfps-radio-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 13px;
}

.wcfps-radio-opt:hover { border-color: #9FE1CB; }

.wcfps-radio-opt input[type=radio] { cursor: pointer; flex-shrink: 0; accent-color: #1D9E75; }

.wcfps-radio-opt:has(input:checked) {
    border-color: #1D9E75;
    background: #f0fdf8;
}

.wcfps-radio-label { flex: 1; color: #111827; font-weight: 500; }

.wcfps-radio-extra {
    font-size: 11px;
    font-weight: 600;
    color: #1D9E75;
    background: #ecfdf5;
    padding: 2px 7px;
    border-radius: 20px;
}

/* ── Dropdown ── */
.wcfps-attr-select {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #111827;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s;
    appearance: auto;
}

.wcfps-attr-select:focus {
    border-color: #1D9E75;
    outline: none;
}

/* ── Hover zoom preview ── */
#wcfps-zoom-preview {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.28);
    border: 2.5px solid #1D9E75;
    background: #f0f0f0;
}

#wcfps-zoom-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Order summary attr detail (color thumbs + size pills) ── */
.wcfps-sum-attr-detail {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcfps-sad-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.wcfps-sad-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    flex-shrink: 0;
}

.wcfps-sad-colors {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

/* Color thumbnail in summary */
.wcfps-sad-thumb {
    width: 22px;
    height: 22px;
    border-radius: 0;
    object-fit: cover;
    border: 1.5px solid #1D9E75;
    display: inline-block;
    vertical-align: middle;
}

/* Color swatch in summary */
.wcfps-sad-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    display: inline-block;
    vertical-align: middle;
}

/* Text pill (size, other) */
.wcfps-sad-pill {
    font-size: 10px;
    font-weight: 600;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
