/**
 * WC Catalog Inquiry - Premium Design System
 */

:root {
    --wci-primary: #7C3B3D;
    --wci-primary-dark: #622e30;
    --wci-bg-overlay: rgba(15, 23, 42, 0.8);
    --wci-bg-container: #ffffff;
    --wci-text-main: #1e293b;
    --wci-text-label: #475569;
    --wci-text-muted: #64748b;
    --wci-border: #e2e8f0;
    --wci-border-focus: #7C3B3D;
    --wci-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --wci-radius-lg: 16px;
    --wci-radius-md: 10px;
    --wci-radius-sm: 6px;
    --wci-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
.wci-modal * {
    box-sizing: border-box !important;
}

/* Trigger Button */
.wc-catalog-inquiry-button-wrapper {
    margin: 24px 0;
}

.premium-inquiry-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 32px !important;
    background: var(--wci-primary) !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: var(--wci-radius-md) !important;
    border: none !important;
    cursor: pointer !important;
    transition: var(--wci-transition) !important;
    box-shadow: 0 4px 6px -1px rgba(124, 59, 61, 0.2) !important;
}

.premium-inquiry-btn:hover {
    background: var(--wci-primary-dark) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(124, 59, 61, 0.3) !important;
}

/* Modal Structure */
.wci-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wci-modal.active {
    opacity: 1;
    visibility: visible;
}

.wci-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--wci-bg-overlay);
    backdrop-filter: blur(4px);
}

.wci-modal-container {
    position: relative;
    background: var(--wci-bg-container);
    width: 90%;
    max-width: 650px;
    padding: 48px;
    border-radius: var(--wci-radius-lg);
    box-shadow: var(--wci-shadow);
    z-index: 101;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.wci-modal.active .wci-modal-container {
    transform: translateY(0);
}

.wci-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--wci-text-muted);
    transition: var(--wci-transition);
}

.wci-modal-close:hover {
    background: #e2e8f0;
    color: var(--wci-text-main);
    transform: rotate(90deg);
}

/* Header */
.wci-modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.wci-modal-title {
    font-size: 32px !important;
    font-weight: 800 !important;
    color: var(--wci-text-main) !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: -0.025em !important;
}

.wci-product-badge {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 10px 20px;
    border-radius: 99px;
    border: 1px solid var(--wci-border);
    font-size: 14px;
    color: var(--wci-text-muted);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.wci-product-name {
    color: var(--wci-primary);
    font-weight: 700;
    margin-left: 4px;
}

/* Form Layout */
.wci-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.wci-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wci-full-width {
    grid-column: span 2;
}

.wci-label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--wci-text-label) !important;
    margin: 0 !important;
    display: block !important;
}

.wci-input-wrapper {
    position: relative;
}

.wci-input-wrapper input,
.wci-input-wrapper textarea {
    width: 100% !important;
    padding: 14px 16px !important;
    background: #f8fafc !important;
    border: 2px solid var(--wci-border) !important;
    border-radius: var(--wci-radius-md) !important;
    font-size: 15px !important;
    color: var(--wci-text-main) !important;
    transition: var(--wci-transition) !important;
}

.wci-input-wrapper input:focus,
.wci-input-wrapper textarea:focus {
    outline: none !important;
    border-color: var(--wci-primary) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(124, 59, 61, 0.1) !important;
}

.wci-input-wrapper textarea {
    resize: vertical;
    min-height: 120px;
}

/* Submit Button */
.wci-submit-btn {
    width: 100% !important;
    padding: 16px !important;
    background: var(--wci-primary) !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: var(--wci-radius-md) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: var(--wci-transition) !important;
}

.wci-submit-btn:hover {
    background: var(--wci-primary-dark) !important;
    box-shadow: 0 4px 12px rgba(124, 59, 61, 0.3) !important;
}

.wci-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wci-btn-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: wci-spin 0.8s linear infinite;
}

@keyframes wci-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Response Message */
.wci-response {
    margin-top: 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    min-height: 24px;
}

.wci-response.success { color: #10b981; }
.wci-response.error { color: #ef4444; }

/* Responsive Adjustments */
@media (max-width: 640px) {
    .wci-modal-container {
        padding: 32px 24px;
    }
    
    .wci-form-grid {
        grid-template-columns: 1fr;
    }
    
    .wci-full-width {
        grid-column: span 1;
    }
    
    .wci-modal-title {
        font-size: 24px !important;
    }
}

/* --- ULTRA-STABLE GRID PRODUCT GALLERY --- */
.woocommerce-product-gallery {
    display: grid !important;
    grid-template-columns: 100px 1fr !important; /* Fixed width for thumbs, fluid for main */
    grid-template-areas: "wci-thumbs wci-main" !important;
    gap: 20px !important;
    opacity: 1 !important; /* Ensure visibility */
    margin-bottom: 2em !important;
}

/* Thumbnails area */
.woocommerce-product-gallery .flex-control-nav {
    grid-area: wci-thumbs !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    position: static !important;
}

.woocommerce-product-gallery .flex-control-nav li {
    width: 100% !important;
    margin: 0 !important;
}

.woocommerce-product-gallery .flex-control-nav li img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    transition: var(--wci-transition) !important;
    cursor: pointer !important;
    opacity: 0.6 !important;
}

.woocommerce-product-gallery .flex-control-nav li img.flex-active {
    border-color: var(--wci-primary) !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(124, 59, 61, 0.2) !important;
}

/* Main Image Wrapper */
.woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
    grid-area: wci-main !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: var(--wci-radius-lg) !important;
}

.woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .woocommerce-product-gallery {
        grid-template-columns: 1fr !important;
        grid-template-areas: "wci-main" "wci-thumbs" !important;
    }
    
    .woocommerce-product-gallery .flex-control-nav {
        flex-direction: row !important;
        justify-content: center !important;
        margin-top: 15px !important;
    }
    
    .woocommerce-product-gallery .flex-control-nav li {
        width: 70px !important;
    }
}
