/**
 * TQS Frontend Styles — Step 2 Mockup Design
 *
 * Two-column layout: vehicle image left, controls right
 * Below: full-width contact form in light grey container
 */

/* ─── Reset & Base ──────────────────────────────────────────────── */

.tqs-widget {
    font-family: var(--tqs-font, Arial, sans-serif);
    color: var(--tqs-primary, #333333);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.tqs-widget * {
    box-sizing: border-box;
}

.tqs-step {
    width: 100%;
    display: none !important;
}

.tqs-step.active {
    display: block !important;
}

/* ─── Step 1: Vehicle Selection Cards ───────────────────── */

.tqs-vehicle-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tqs-vehicle-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: var(--tqs-card-border-radius, 8px);
    background: var(--tqs-card-bg-color, #ffffff) !important;
    border: var(--tqs-card-border-width, 2px) solid var(--tqs-card-border-color, #e0e0e0) !important;
    padding: 16px !important;
    text-align: center !important;
}

.tqs-vehicle-card:hover {
    opacity: 0.9;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--tqs-accent, #0073aa) !important;
}

.tqs-vehicle-card.selected {
    border-color: var(--tqs-accent, #0073aa) !important;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.2) !important;
}

.tqs-vehicle-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Title below image (h3 in vehicle card) */
.tqs-vehicle-card h3 {
    margin: 8px 0 0 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--tqs-primary-color, #333333);
    text-align: center;
}

/* Image wrapper for overlay titles */
.tqs-image-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.tqs-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Title overlay centered on image */
.tqs-card-title-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
    color: #ffffff;
    font-size: 1.2em;
    font-weight: bold;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 4px;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.tqs-vehicle-placeholder {
    font-size: 3em;
    padding: 20px;
}

.tqs-select-btn {
    display: inline-block;
    margin-top: 10px;
    color: var(--tqs-accent, #0073aa);
    font-weight: bold;
}

/* ─── Step 2: Quote Layout ──────────────────────────────── */

.tqs-quote-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

/* LEFT column — Vehicle Image Display */
.tqs-image-column {
    flex: 2;
    position: relative;
    min-height: 400px;
}

.tqs-back-link {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    color: #333;
    text-decoration: none;
    font-size: 0.9em;
    padding: 6px 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.tqs-back-link:hover {
    background: #fff;
    text-decoration: none;
}

.tqs-image-display {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--tqs-image-bg, #f5f5f5);
    position: relative;
}

.tqs-image-display img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* RIGHT column — Controls */
.tqs-controls-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tqs-heading-quote {
    font-size: 1.8em;
    margin: 0 0 5px 0;
    padding: 0;
    color: var(--tqs-primary, #333);
    font-weight: bold;
}

.tqs-heading-tint-level {
    font-size: 1.2em;
    margin: 0 0 8px 0;
    padding: 0;
    color: #666;
    font-weight: normal;
}

/* ─── Step 1 Vehicle Select Heading ────────────────────── */

.tqs-heading-vehicle-select {
    text-align: center;
    margin: 0 0 24px 0;
    padding: 0;
    color: var(--tqs-heading-vs-color, #333);
    font-size: var(--tqs-heading-vs-size, 24px);
    font-family: var(--tqs-heading-vs-font, var(--tqs-font, Arial, sans-serif));
    font-weight: bold;
}

/* ─── Tint Type Buttons (Mockup Grid Layout) ────────────── */

.tqs-tint-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Third button spans full width below the first two */
.tqs-tint-tab:nth-child(3) {
    grid-column: 1 / -1;
}

.tqs-tint-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border: none;
    border-radius: 8px;
    color: var(--tqs-btn-text-color, #fff);
    font-size: var(--tqs-btn-text-size, 14px);
    font-family: var(--tqs-btn-text-font, var(--tqs-font, Arial, sans-serif));
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    text-align: center;
    position: relative;
    /* Dim unselected tint buttons */
    opacity: 0.65;
}

.tqs-tint-tab:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0.85;
}

/* Active state — accent border ring + scale up + checkmark */
.tqs-tint-tab.active {
    outline: none;
    outline-offset: 0;
    transform: scale(1.06);
    box-shadow: 0 0 0 3px var(--tqs-btn-accent, #0073aa), 0 4px 20px rgba(0,0,0,0.25);
    opacity: 1;
}

.tqs-tint-tab.active::after {
    content: '\2713';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: var(--tqs-btn-accent, #0073aa);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Color swatch inside tint button */
.tint-swatch {
    display: none; /* Hidden in mockup design — color comes from button bg */
}

/* ─── Package Selection (Mockup Button Grid) ────────────── */

.tqs-packages-section h4,
.tqs-addons-section h4 {
    font-size: 1.1em;
    margin: 0 0 12px 0;
    color: var(--tqs-primary, #333);
}

.tqs-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

/* Package buttons — mockup style */
.tqs-package-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--tqs-pkg-unselected-bg, #f8f9fa);
    color: var(--tqs-pkg-unselected-text, #333333);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.tqs-package-card:hover {
    border-color: #999;
    background: #eee;
}

/* Selected package — background/text color change only */
.tqs-package-card.selected {
    background: var(--tqs-pkg-selected-bg, #1a1a1a);
    color: var(--tqs-pkg-selected-text, #ffffff);
    opacity: 1;
}

.tqs-package-card h4 {
    margin: 0;
    padding: 0;
    font-size: var(--tqs-pkg-btn-text-size, 14px);
    font-family: var(--tqs-btn-text-font, var(--tqs-font, Arial, sans-serif));
    font-weight: 600;
    color: inherit;
}

.tqs-price {
    font-size: var(--tqs-price-size, 14px);
    color: var(--tqs-price-color, #666666);
    font-family: var(--tqs-price-font, var(--tqs-font, Arial, sans-serif));
    opacity: 0.8;
    display: block;
}

/* Price inherits text color inside selected package/addon cards */
.tqs-package-card.selected .tqs-price,
.tqs-addon-card.selected .tqs-price {
    color: inherit;
    opacity: 1;
}

/* Hide prices when show_prices is disabled */
.tqs-widget:not([data-show-prices="1"]) .tqs-price {
    display: none;
}

/* Hide placeholder icons in packages */
.tqs-package-card .tqs-vehicle-placeholder {
    display: none;
}

/* Hide separate toggle buttons — entire card is clickable */
.tqs-toggle-btn {
    display: none;
}

/* ─── Section Headings (Package & Add-Ons) ──────────────── */

.tqs-heading-package,
.tqs-heading-addons {
    font-size: 1.1em;
    margin: 0 0 8px 0;
    padding: 0;
    color: #666;
}

/* ─── Add-Ons (Mockup Style) ────────────────────────────── */

.tqs-addons-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tqs-addon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--tqs-pkg-unselected-bg, #f8f9fa);
    color: var(--tqs-pkg-unselected-text, #333333);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tqs-addon-card:hover {
    border-color: #999;
    background: #eee;
}

/* Selected addon — background/text color change only */
.tqs-addon-card.selected {
    background: var(--tqs-pkg-selected-bg, #1a1a1a);
    color: var(--tqs-pkg-selected-text, #ffffff);
    opacity: 1;
}

.tqs-addon-card h4 {
    margin: 0;
    padding: 0;
    font-size: var(--tqs-addon-btn-text-size, 14px);
    font-family: var(--tqs-btn-text-font, var(--tqs-font, Arial, sans-serif));
    font-weight: 600;
    color: inherit;
}

/* ─── Price Display (Simple Line — Mockup Style) ────────── */

.tqs-price-section {
    margin-top: 15px;
    padding: 12px 0;
    border-top: 2px solid #e0e0e0;
}

.tqs-price-label {
    display: none; /* Hide the "Total:" label from PHP — we render our own */
}

.tqs-price-display {
    font-size: var(--tqs-total-price-size, 1.3em);
    font-weight: bold;
    color: var(--tqs-total-price-color, var(--tqs-primary, #333));
    font-family: var(--tqs-total-price-font, var(--tqs-font, Arial, sans-serif));
}

/* Price breakdown rows (hidden in mockup) */
.tqs-price-row {
    display: none;
}

.tqs-price-total {
    display: block !important;
}

/* ─── Contact Form (Mockup Style) ───────────────────────── */

.tqs-contact-form-container {
    margin-top: 40px;
    padding: 30px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Slide-down + fade-in animation for "Hide Until Package Selected" */
.tqs-contact-form-container.tqs-contact-hidden {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tqs-contact-form-container:not(.tqs-contact-hidden) {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tqs-contact-form h3 {
    font-size: 1.4em;
    text-align: left;
    margin-bottom: 25px;
    color: var(--tqs-primary, #333);
}

.tqs-heading-vehicle {
    font-size: 1.1em;
    margin: 20px 0 15px 0;
    padding: 0;
    color: #666;
    text-align: left;
}

.tqs-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tqs-field {
    flex: 1;
    min-width: 180px;
}

.tqs-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9em;
    color: #555;
}

.tqs-field input[type="text"],
.tqs-field input[type="email"],
.tqs-field input[type="tel"],
.tqs-field input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.tqs-field input:focus {
    outline: none;
    border-color: var(--tqs-accent, #0073aa);
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.tqs-field input.error {
    border-color: #dc3545;
}

/* Agreement Checkbox */
.tqs-agreement-field {
    margin: 20px 0;
    text-align: left;
}

.tqs-checkbox-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95em;
}

.tqs-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--tqs-accent, #0073aa);
}

.tqs-agreement-field.error .tqs-checkbox-label {
    color: #dc3545;
}

/* Submit Button — Black bg, white text (mockup style) */
.tqs-submit-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    margin-top: 20px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.tqs-submit-btn:hover:not(:disabled) {
    background: #333;
    transform: translateY(-1px);
}

.tqs-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Messages ──────────────────────────────────────────── */

.tqs-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 1em;
    text-align: center;
}

.tqs-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tqs-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ─── Responsive Layout ─────────────────────────────────── */

@media (max-width: 900px) {
    .tqs-quote-layout {
        flex-direction: column;
    }

    .tqs-image-column {
        flex: none;
        min-height: 300px;
    }

    .tqs-controls-column {
        flex: none;
    }

    .tqs-field {
        min-width: 140px;
    }

    .tqs-packages-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 600px) {
    .tqs-widget {
        padding: 15px;
    }

    .tqs-vehicle-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .tqs-heading-quote {
        font-size: 1.4em;
    }

    .tqs-tint-tab {
        padding: 12px 14px;
        font-size: 0.85em;
    }

    .tqs-form-row {
        flex-direction: column;
    }

    .tqs-field {
        min-width: 100%;
    }

    .tqs-price-display {
        font-size: var(--tqs-total-price-size, 1.1em);
    }

    .tqs-contact-form-container {
        padding: 20px;
    }
}

@media (max-width: 400px) {
    .tqs-vehicle-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ─── Success Message Container ─────────────────────────────────── */

.tqs-success-message {
    text-align: center;
    padding: 60px 20px;
    margin-top: 40px;
}

.tqs-success-message h2 {
    font-size: 1.8em;
    color: var(--tqs-primary, #333333);
    margin-bottom: 24px;
    padding: 0;
}

.tqs-cta-button {
    display: inline-block;
    background-color: var(--tqs-accent, #0073aa);
    color: #ffffff !important;
    padding: 14px 32px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.tqs-cta-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.tqs-cta-button:active {
    transform: translateY(0);
}
