/* ----------------------------------------------------------
   WooCommerce Product Inquiry - COMPLETE FRONTEND STYLES
----------------------------------------------------------- */

/* ===========================
   Inquiry Button Styles
=========================== */
.wpi-inquiry-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 5px;
    text-decoration: none;
    line-height: 1;
}

.wpi-inquiry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wpi-inquiry-button:active {
    transform: translateY(0);
}

/* Button Colors */
.wpi-button-primary { background-color: #0073aa; color: white; }
.wpi-button-primary:hover { background-color: #005a87; }

.wpi-button-secondary { background-color: #6c757d; color: white; }
.wpi-button-secondary:hover { background-color: #5a6268; }

.wpi-button-success { background-color: #28a745; color: white; }
.wpi-button-success:hover { background-color: #218838; }

.wpi-button-info { background-color: #17a2b8; color: white; }
.wpi-button-info:hover { background-color: #138496; }

/* Loop Button Full Width */
.wpi-inquiry-button-loop {
    width: 100%;
    margin-top: 5px;
}

/* ===========================
   Modal Wrapper
=========================== */
.wpi-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

.wpi-modal.wpi-modal-open {
    display: block;
}

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

/* Dark Overlay */
.wpi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(2px);
}

/* Modal Content */
.wpi-modal-content {
    position: relative;
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);

    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===========================
   Close Button (FIXED)
=========================== */
.wpi-modal-close {
    position: absolute !important;
    top: 10px !important;
    right: 15px !important;
    left: auto !important;
    width: 40px !important;
    height: 40px !important;
    background: #dc3545 !important;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    cursor: pointer !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    color: #fff !important;
    font-size: 20px !important;
    line-height: 1 !important;
    font-weight: bold !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;

    z-index: 99999 !important;
    transition: all 0.3s ease !important;
}

.wpi-modal-close:hover {
    background: #c82333 !important;
    transform: scale(1.1) !important;
}

/* ===========================
   Modal Header
=========================== */
.wpi-modal-header {
    padding: 25px 70px 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.wpi-modal-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #333;
}

.wpi-modal-header p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Product Name Display */
.wpi-product-info-display {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.wpi-product-info-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.wpi-product-name-display {
    font-weight: 600;
    color: #0073aa;
}

/* ===========================
   Form Styles
=========================== */
.wpi-form {
    padding: 20px 30px 25px;
    overflow-y: auto;
    flex: 1;
}

.wpi-form-messages {
    display: none;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.wpi-form-messages.wpi-success {
    display: block;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wpi-form-messages.wpi-error {
    display: block;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Form 2-column grid */
.wpi-form-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 15px;
    margin-bottom: 15px;
}

/* Single Input Box */
.wpi-form-group {
    margin-bottom: 15px;
}

.wpi-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.wpi-form-group label .required {
    color: #dc3545;
}

.wpi-form-group input,
.wpi-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    font-family: inherit;

    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-sizing: border-box;

    transition: border-color .3s, box-shadow .3s ease;
}

.wpi-form-group input:focus,
.wpi-form-group textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    outline: none;
}

.wpi-form-group textarea {
    resize: vertical;
    min-height: 50px;
}

/* Submit Button */
.wpi-submit-button {
    width: 100%;
    padding: 14px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
    transition: background-color .3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.wpi-submit-button:hover:not(:disabled) {
    background-color: #005a87;
}

.wpi-submit-button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Spinner */
.wpi-spinner {
    width: 20px;
    height: 20px;
    animation: rotate 2s linear infinite;
}

.wpi-spinner .path {
    stroke: #fff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate { 100% { transform: rotate(360deg); } }

@keyframes dash {
    0% { stroke-dasharray: 1,150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90,150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90,150; stroke-dashoffset: -124; }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    .wpi-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .wpi-form {
        padding: 20px;
    }

    .wpi-form-grid {
        grid-template-columns: 1fr;
    }

    .wpi-inquiry-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wpi-modal-content {
        margin: 10px;
        border-radius: 4px;
        max-height: calc(100vh - 20px);
    }

    .wpi-form {
        padding: 15px;
    }

    .wpi-inquiry-button {
        width: 100%;
    }
}
