/**
 * Mosestance Customize Now v3.2 — Clean DOM-move modal
 * v3.0: header/content/footer layout. WCPA form lives in .customize-now-content,
 *       price + ATC in .customize-now-footer. Panel scrolls content, footer sticks.
 */

/* Hide WCPA inline form when NOT inside the modal */
.wcpa_form_outer:not(.customize-now-content .wcpa_form_outer) { display: none !important; }

/* Button */
.customize-now-btn-wrap { margin: 16px 0; }
.customize-now-btn {
    display: inline-block !important; width: 100% !important; height: 48px !important;
    border: 1px solid #FCD200 !important; border-radius: 20px !important;
    background: #FFD814 !important;
    color: #0F1111 !important; font-size: 15px !important; font-weight: 400 !important;
    cursor: pointer !important; text-align: center !important;
    transition: background 0.15s ease !important;
    box-shadow: 0 2px 5px rgba(213,217,217,0.5) !important;
}
.customize-now-btn:hover { background: linear-gradient(to bottom, #F7CA00, #F0B800) !important; }
.customize-now-btn:active { background: #F0B800 !important; box-shadow: none !important; }

/* Overlay */
.customize-now-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    animation: cnOverlayFadeIn 0.2s ease;
}
@keyframes cnOverlayFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Panel */
.customize-now-panel {
    background: #FFFFFF; border-radius: 12px;
    width: 90%; max-width: 520px; max-height: 85vh;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.08);
    animation: cnPanelSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
@keyframes cnPanelSlideIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.customize-now-header {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 12px;
    border-bottom: 1px solid #E7E7E7;
}
.customize-now-title {
    font-size: 18px; font-weight: 700; color: #0F1111;
    margin: 0; line-height: 1.3;
}
.customize-now-close {
    width: 36px; height: 36px; border: none; flex-shrink: 0;
    background: transparent; font-size: 28px; line-height: 36px;
    color: #565959; cursor: pointer; border-radius: 50%;
    transition: background 0.15s, color 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.customize-now-close:hover { background: #F0F2F2; color: #0F1111; }

/* Content — scrollable, WCPA form goes here */
.customize-now-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 24px;
    scrollbar-width: thin; scrollbar-color: #C1C1C1 transparent;
}
.customize-now-content::-webkit-scrollbar { width: 6px; }
.customize-now-content::-webkit-scrollbar-thumb { background: #C1C1C1; border-radius: 3px; }

/* Footer — price + ATC, sticky at bottom */
.customize-now-footer {
    flex-shrink: 0;
    padding: 12px 24px 20px;
    border-top: 1px solid #E7E7E7;
}
.customize-now-footer .woocommerce-variation-add-to-cart,
.customize-now-footer .single_variation_wrap,
.customize-now-footer .variations_button { display: block !important; }
.customize-now-footer .quantity { width: 100% !important; display: block !important; float: none !important; }
.customize-now-footer .woocommerce-variation-add-to-cart .quantity { width: 100% !important; display: block !important; }
.customize-now-footer .woocommerce-variation-add-to-cart .quantity input { width: 100% !important; }
.customize-now-footer .woocommerce-variation-price { margin-bottom: 12px; }
.customize-now-footer .single_add_to_cart_button {
    display: block !important;
    float: none !important;
    width: 100% !important;
}

/* Tablet */
@media screen and (max-width: 1024px) {
    .customize-now-panel { width: 95%; max-height: 90vh; border-radius: 10px; }
    .customize-now-header { padding: 18px 18px 10px; }
    .customize-now-content { padding: 14px 18px; }
    .customize-now-footer { padding: 10px 18px 16px; }
    .customize-now-title { font-size: 17px; }
    .customize-now-btn { font-size: 14px !important; height: 44px !important; }
}

/* Mobile — bottom sheet */
@media screen and (max-width: 768px) {
    .customize-now-overlay { align-items: flex-end; }
    .customize-now-panel {
        width: 100%; max-width: 100%; max-height: 90vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    }
    .customize-now-header { padding: 16px 16px 10px; }
    .customize-now-content { padding: 12px 16px; }
    .customize-now-footer { padding: 10px 16px 14px; }
    .customize-now-title { font-size: 16px; }
    .customize-now-btn { font-size: 14px !important; height: 44px !important; }
}

/* ===== v3.1: Hide quantity + ATC on main page for customizable products ===== */
.wcpa_has_options .woocommerce-variation-add-to-cart:not(.customize-now-footer .woocommerce-variation-add-to-cart) {
    display: none !important;
}
.wcpa_has_options form.cart .quantity:not(.customize-now-footer .quantity) {
    display: none !important;
}
