/* Vega Product Quote System - Frontend Styles */
/* Version: 1.1.0 */

/* =====================================================
   ELEMENTOR WIDGET - BUTTONS CONTAINER
   ===================================================== */
.vega-buttons-container {
    display: flex;
    flex-wrap: wrap;
}

.vega-buttons-container.layout-horizontal {
    flex-direction: row;
}

.vega-buttons-container.layout-vertical {
    flex-direction: column;
}

.vega-buttons-container.layout-vertical.stretch .vega-product-btn {
    width: 100%;
}

/* =====================================================
   ELEMENTOR WIDGET - BUTTONS BASE STYLE
   ===================================================== */
.vega-product-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    line-height: 1.4;
}

.vega-product-btn .button-icon {
    display: inline-flex;
    align-items: center;
}

.vega-product-btn .button-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.vega-product-btn .button-text {
    display: inline-block;
}

/* Default colors (can be overridden by Elementor) */
.vega-quote-btn {
    background-color: #0066cc;
    color: #ffffff;
}

.vega-quote-btn:hover {
    background-color: #0052a3;
    color: #ffffff;
}

.vega-dimensions-btn {
    background-color: #28a745;
    color: #ffffff;
}

.vega-dimensions-btn:hover {
    background-color: #218838;
    color: #ffffff;
}

/* =====================================================
   LEGACY - QUOTE BUTTONS (non-Elementor)
   ===================================================== */
.vega-quote-button,
.vega-quote-button-single {
    background-color: #0066cc !important;
    color: #fff !important;
    padding: 12px 30px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    text-align: center;
}

.vega-quote-button:hover,
.vega-quote-button-single:hover {
    background-color: #0052a3 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.vega-quote-button-wrapper {
    margin: 20px 0;
}

/* =====================================================
   LEGACY - DIMENSIONS BUTTON (non-Elementor)
   ===================================================== */
.vega-dimensions-button-wrapper {
    margin: 15px 0;
}

.vega-dimensions-button {
    background-color: #28a745 !important;
    color: #fff !important;
    padding: 10px 25px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
}

.vega-dimensions-button:hover {
    background-color: #218838 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* =====================================================
   DIMENSIONS DRAWER (Side Panel)
   ===================================================== */
.vega-dimensions-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

.vega-dimensions-drawer.active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

/* Overlay */
.vega-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Drawer Content */
.vega-drawer-content {
    position: absolute;
    top: 0;
    right: -500px;
    width: 90%;
    max-width: 500px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.vega-dimensions-drawer.active .vega-drawer-content {
    right: 0;
}

/* Drawer Header */
.vega-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.vega-drawer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.vega-drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.vega-drawer-close:hover {
    color: #333;
    background: #eee;
}

/* Drawer Body */
.vega-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vega-drawer-image {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* =====================================================
   QUOTE FORM
   ===================================================== */
.vega-quote-form-wrapper {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.vega-quote-product-info {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.vega-quote-product-info h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.vega-form-row {
    margin-bottom: 20px;
}

.vega-form-row label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.vega-form-row .required {
    color: #e74c3c;
}

.vega-form-row input[type="text"],
.vega-form-row input[type="email"],
.vega-form-row input[type="tel"],
.vega-form-row textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.vega-form-row input:focus,
.vega-form-row textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.vega-form-row textarea {
    resize: vertical;
    min-height: 120px;
}

.vega-submit-quote {
    background-color: #0066cc !important;
    color: #fff !important;
    padding: 14px 35px !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100%;
}

.vega-submit-quote:hover {
    background-color: #0052a3 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.vega-submit-quote:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Form Messages */
.vega-quote-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
    font-size: 14px;
}

.vega-quote-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.vega-quote-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Loading Spinner */
.vega-loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: vega-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes vega-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .vega-quote-form-wrapper {
        padding: 20px;
        margin: 20px 15px;
    }
    
    .vega-drawer-content {
        width: 100%;
        max-width: 100%;
    }
    
    .vega-drawer-body {
        padding: 15px;
    }
    
    .vega-quote-button,
    .vega-quote-button-single,
    .vega-dimensions-button {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .vega-buttons-container.layout-horizontal {
        flex-direction: column;
    }
    
    .vega-buttons-container .vega-product-btn {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   THEME COMPATIBILITY
   ===================================================== */
/* WoodMart */
.product-type-simple .vega-quote-button-wrapper,
.product-type-simple .vega-dimensions-button-wrapper {
    margin-top: 15px;
}

.single-product .summary .vega-quote-button-single {
    margin-bottom: 10px;
}

/* Catalog Mode */
body.catalog-mode .add_to_cart_button {
    display: none !important;
}
