/* ============================================
   SAATTCO Wholesale CRM - Enhanced Styles
   Matches theme design with flexible overrides
   ============================================ */

/* Container */
.saattco-wcrm-container {
    margin: 25px 0 15px;
    position: relative;
}

/* ============================================
   ENQUIRY BUTTON
   ============================================ */

.saattco-wcrm-open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    min-width: 200px;
    
    /* Colors - Inherit from theme */
    color: #ffffff;
    background: #1a1a2e; /* Dark base - change to match your theme */
    
    /* Border & Effects */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    
    /* Typography */
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Positioning */
    position: relative;
    overflow: hidden;
}

/* Button Hover State */
.saattco-wcrm-open-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Button Active State */
.saattco-wcrm-open-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Button Focus State */
.saattco-wcrm-open-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Button Icon (optional) */
.saattco-wcrm-open-button::before {
    content: "↗";
    font-size: 18px;
    transition: transform 0.3s ease;
}

.saattco-wcrm-open-button:hover::before {
    transform: translate(2px, -2px);
}

/* Button Note */
.saattco-wcrm-note {
    margin: 10px 0 0;
    font-size: 13px;
    color: #666;
    opacity: 0.8;
}

/* ============================================
   MODAL OVERLAY
   ============================================ */

.saattco-wcrm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    
    /* Animation */
    animation: saattcoModalFadeIn 0.3s ease;
}

.saattco-wcrm-modal[hidden] {
    display: none;
}

/* Modal Overlay Background */
.saattco-wcrm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    
    /* Animation */
    animation: saattcoOverlayFadeIn 0.3s ease;
}

/* ============================================
   MODAL DIALOG
   ============================================ */

.saattco-wcrm-dialog {
    position: relative;
    width: 100%;
    max-width: 740px;
    max-height: 90vh;
    overflow-y: auto;
    
    /* Background */
    background: #ffffff;
    border-radius: 12px;
    
    /* Shadow */
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    
    /* Animation */
    animation: saattcoDialogSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.saattco-wcrm-dialog::-webkit-scrollbar {
    width: 6px;
}

.saattco-wcrm-dialog::-webkit-scrollbar-track {
    background: transparent;
}

.saattco-wcrm-dialog::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ============================================
   MODAL HEADER
   ============================================ */

.saattco-wcrm-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 30px 20px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0;
}

.saattco-wcrm-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

/* Close Button */
.saattco-wcrm-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    
    font-size: 28px;
    line-height: 1;
    color: #999;
    
    transition: all 0.2s ease;
}

.saattco-wcrm-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: rotate(90deg);
}

.saattco-wcrm-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* ============================================
   MODAL BODY
   ============================================ */

.saattco-wcrm-body {
    padding: 0 30px 30px;
}

/* Product Info Box */
.saattco-wcrm-product {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 25px;
    padding: 15px 20px;
    
    background: #f8f9fa;
    border-left: 4px solid #1a1a2e;
    border-radius: 4px;
}

.saattco-wcrm-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.saattco-wcrm-product-sku {
    font-size: 13px;
    color: #666;
}

.saattco-wcrm-product-sku strong {
    color: #444;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.saattco-wcrm-form {
    position: relative;
}

/* Grid Layout */
.saattco-wcrm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* Form Field */
.saattco-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saattco-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.saattco-field label .required {
    color: #dc3545;
    margin-left: 2px;
}

.saattco-field input,
.saattco-field select,
.saattco-field textarea {
    width: 100%;
    padding: 10px 12px;
    
    border: 1.5px solid #ddd;
    border-radius: 4px;
    
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #ffffff;
    
    transition: all 0.2s ease;
}

.saattco-field input:hover,
.saattco-field select:hover,
.saattco-field textarea:hover {
    border-color: #bbb;
}

.saattco-field input:focus,
.saattco-field select:focus,
.saattco-field textarea:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

.saattco-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Field Helper Text */
.saattco-field .helper-text {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Full-width fields */
.saattco-full {
    grid-column: 1 / -1;
}

/* ============================================
   HONEYPOT
   ============================================ */

.saattco-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.saattco-wcrm-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 25px;
    padding: 14px 32px;
    
    /* Colors - Match your theme */
    color: #ffffff;
    background: #1a1a2e;
    
    border: none;
    border-radius: 4px;
    cursor: pointer;
    
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    
    transition: all 0.3s ease;
    
    position: relative;
    overflow: hidden;
}

.saattco-wcrm-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.saattco-wcrm-submit:active:not(:disabled) {
    transform: translateY(0);
}

.saattco-wcrm-submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

/* Submit Button Spinner */
.saattco-wcrm-submit .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: saattcoSpin 0.6s linear infinite;
}

.saattco-wcrm-submit.loading .spinner {
    display: inline-block;
}

/* ============================================
   STATUS MESSAGES
   ============================================ */

.saattco-wcrm-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.saattco-wcrm-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.saattco-wcrm-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.saattco-wcrm-status.loading {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes saattcoModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes saattcoOverlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes saattcoDialogSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes saattcoSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   BODY NO SCROLL
   ============================================ */

body.saattco-wcrm-no-scroll {
    overflow: hidden;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .saattco-wcrm-dialog {
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .saattco-wcrm-header {
        padding: 18px 20px 15px;
    }
    
    .saattco-wcrm-header h2 {
        font-size: 18px;
    }
    
    .saattco-wcrm-body {
        padding: 0 20px 20px;
    }
    
    .saattco-wcrm-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .saattco-wcrm-full {
        grid-column: auto;
    }
    
    .saattco-wcrm-product {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .saattco-wcrm-open-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .saattco-wcrm-dialog {
        max-height: 98vh;
        border-radius: 0;
    }
    
    .saattco-wcrm-header {
        padding: 14px 16px 12px;
    }
    
    .saattco-wcrm-header h2 {
        font-size: 16px;
    }
    
    .saattco-wcrm-body {
        padding: 0 16px 16px;
    }
    
    .saattco-wcrm-close {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
}