/* =============================================================================
   Blinds Order Panel — bop-panel styles
   Rename .bop-* classes for other panel plugins (e.g. cop-* for curtains)
   The #bsp-* IDs are shared with Window Cover Pricing JS — keep them.
============================================================================= */

/* Panel container */
.bop-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-family: inherit;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Header ────────────────────────────────────────────────── */
.bop-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.bop-header-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}
.bop-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

/* Placeholder shown before a colour is selected */
.bsp-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

/* Installed lifestyle photo */
#bsp-installed-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    border-radius: 8px;
    transition: opacity 0.25s ease;
}

/* Colour chip + label row */
.bsp-colour-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 2px;
}
.bsp-colour-chip {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    display: none;
}

.bop-header-info { flex: 1; min-width: 0; }
.bop-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
}
.bop-colour-selected {
    font-size: 13px;
    color: #6b7280;
}

/* ── Dimensions ────────────────────────────────────────────── */
.bop-dimensions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
}
.bop-dim-block { text-align: center; }
.bop-dim-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.bop-dim-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}
.bop-dim-divider {
    font-size: 18px;
    color: #d1d5db;
    font-weight: 300;
}

/* ── Divider ────────────────────────────────────────────────── */
.bop-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 14px 0;
}

/* ── Options list ───────────────────────────────────────────── */
.bop-options-section { margin-bottom: 4px; }
.bop-options-title {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.bop-options-empty {
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* ── Accessories section header (between blind options + accessory rows) ── */
.bsp-accessories-header {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 10px;
    margin-bottom: 6px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}

/* ── Option rows ────────────────────────────────────────────── */
.bsp-option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    gap: 8px;
}
.bsp-option-row:last-child { border-bottom: none; }
.bsp-opt-label {
    color: #6b7280;
    flex-shrink: 0;
    flex: 1;
}
.bsp-opt-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    text-align: right;
    flex-shrink: 0;
}
.bsp-opt-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* Standard priced addon badge — green */
.bsp-opt-price {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 1px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Accessory price badge — blue/info to visually distinguish from blind addons */
.bsp-opt-price--accessory {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* ── Price section ──────────────────────────────────────────── */
.bop-price-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bop-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.bop-price-label { color: #6b7280; }
.bop-price-value { font-weight: 500; color: #1a1a1a; }
.bop-price-total,
.bop-price-total .woocommerce-Price-amount {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Accessories subtotal row — visually separated from blind totals */
.bop-price-row--accessories {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}
.bop-price-label--accessories {
    color: #6b7280;
    font-size: 13px;
}
.bop-price-value--accessories {
    font-weight: 600;
    color: #1e40af;
    font-size: 14px;
}

/* Blind grand total row — slightly heavier separator above it */
.bop-price-row--total {
    padding-top: 6px;
    border-top: 1px solid #e5e7eb;
    margin-top: 2px;
}

/* ── Room tag ───────────────────────────────────────────────── */
.bop-room-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    margin-bottom: 4px;
}
.bop-room-label { color: #16a34a; font-weight: 500; }
.bop-room-name  { color: #15803d; }

/* ── Confirmation checkbox ──────────────────────────────────── */
.bop-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 12px;
}
.bop-confirm-check-wrap {
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
}
.bop-confirm-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.bop-confirm-box {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}
.bop-confirm-box svg { opacity: 0; transition: opacity 0.1s; }
.bop-confirm-input:checked ~ .bop-confirm-box {
    background: #1a1a1a;
    border-color: #1a1a1a;
}
.bop-confirm-input:checked ~ .bop-confirm-box svg { opacity: 1; }

/* ── Add to cart button — brand orange ──────────────────────── */
.bop-atc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #2096F3 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}
.bop-atc-btn:hover:not(:disabled) { background: #007CFB !important; }
.bop-atc-btn:disabled,
.bop-atc-btn[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
}
.bop-atc-btn.loading { opacity: 0.7; cursor: wait; }

/* ── WCP error notice ───────────────────────────────────────── */
.wcp-error-notice {
    font-size: 13px;
    color: #c0392b;
    margin: 6px 0 4px;
    padding: 8px 12px;
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 6px;
    font-weight: 500;
}

/* =============================================================================
   HIDE NATIVE WOOCOMMERCE PRICE + CART CONTROLS
   Only active when PHP adds .bop-hide-native-cart to <body>.
============================================================================= */

body.bop-hide-native-cart form.cart .quantity,
body.bop-hide-native-cart form.cart .single_add_to_cart_button,
body.bop-hide-native-cart .prad-product-price-summary,
body.bop-hide-native-cart #wc-stripe-express-checkout-element,
body.bop-hide-native-cart wc-order-attribution-inputs {
    display: none !important;
}

/* Admin debug mode */
body.bop-hide-native-cart.bop-debug-mode form.cart .quantity,
body.bop-hide-native-cart.bop-debug-mode form.cart .single_add_to_cart_button,
body.bop-hide-native-cart.bop-debug-mode .prad-product-price-summary,
body.bop-hide-native-cart.bop-debug-mode #wc-stripe-express-checkout-element,
body.bop-hide-native-cart.bop-debug-mode wc-order-attribution-inputs {
    display: block !important;
}
body.bop-hide-native-cart.bop-debug-mode form.cart .single_add_to_cart_button {
    display: inline-block !important;
}
body.bop-hide-native-cart.bop-debug-mode form.cart .quantity {
    display: inline-flex !important;
}
body.bop-hide-native-cart.bop-debug-mode .prad-product-price-summary::before {
    content: '⚠ WC native price (debug only)';
    display: block;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
}

/* =============================================================================
   ADMIN DEBUG TOGGLE BUTTON
============================================================================= */

#bop-debug-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #1c1c1c;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: background 0.15s;
    font-family: inherit;
}
#bop-debug-toggle:hover { background: #374151; }
#bop-debug-toggle.active { background: #ffc107; color: #1c1c1c; }
#bop-debug-toggle svg { width: 13px; height: 13px; flex-shrink: 0; }
