/* ==========================================================================
   QUOTE REQUEST MODAL STYLES
   ========================================================================== */

/* Modal Container */
.ts-quote-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ts-quote-modal.active {
    display: flex;
}

.ts-quote-modal.closing {
    display: flex;
    pointer-events: none;
}

/* Overlay */
.ts-quote-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(42, 37, 32, 0.5);
    backdrop-filter: blur(10px);
}

/* Modal Content Container */
.ts-quote-modal-container {
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(42, 37, 32, 0.08);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(42, 37, 32, 0.15);
}

/* Close Button */
.ts-quote-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 37, 32, 0.04);
    border: 1px solid rgba(42, 37, 32, 0.06);
    border-radius: 10px;
    color: var(--ts-silver, #5a5048);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.ts-quote-modal-close:hover {
    background: rgba(192, 128, 112, 0.2);
    color: #c08070;
    border-color: rgba(192, 128, 112, 0.3);
}

/* Header */
.ts-quote-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(42, 37, 32, 0.06);
}

.ts-quote-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ts-white, #2a2520);
    margin: 0 0 8px 0;
}

.ts-quote-modal-subtitle {
    font-size: 0.9rem;
    color: var(--ts-silver, #5a5048);
    margin: 0;
}

/* Body */
.ts-quote-modal-body {
    padding: 25px 30px 30px;
}

/* Configuration Summary */
.ts-quote-summary {
    background: rgba(42, 37, 32, 0.05);
    border: 1px solid rgba(42, 37, 32, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.ts-quote-summary-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ts-silver, #5a5048);
    margin-bottom: 15px;
}

.ts-quote-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ts-quote-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ts-quote-summary-label {
    font-size: 0.75rem;
    color: var(--ts-silver, #5a5048);
}

.ts-quote-summary-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ts-white, #2a2520);
}

.ts-quote-summary-price .ts-quote-summary-value {
    color: #c08070;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Custom Dimensions Section */
.ts-quote-custom-size {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(192, 128, 112, 0.05);
    border: 1px solid rgba(192, 128, 112, 0.2);
    border-radius: 12px;
}

.ts-quote-custom-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ts-quote-custom-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #c08070;
    cursor: pointer;
}

.ts-quote-custom-toggle label {
    font-size: 0.9rem;
    color: var(--ts-white, #2a2520);
    cursor: pointer;
}

/* Animated custom fields container */
.ts-quote-custom-fields {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease, padding-top 0.35s ease;
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid transparent;
}

.ts-quote-custom-fields.active {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 15px;
    padding-top: 15px;
    border-top-color: rgba(42, 37, 32, 0.06);
}

.ts-quote-custom-fields-inner {
    overflow: hidden;
}

.ts-quote-note {
    font-size: 0.85rem;
    color: var(--ts-silver, #5a5048);
    margin: 0 0 15px 0;
}

/* Form Styles */
.ts-quote-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Phone Contact Option */
.ts-quote-phone-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(192, 128, 112, 0.08);
    border: 1px solid rgba(192, 128, 112, 0.2);
    border-radius: 10px;
    margin-bottom: 5px;
}

.ts-quote-phone-label {
    font-size: 0.9rem;
    color: var(--ts-silver, #5a5048);
}

.ts-quote-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #c08070;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ts-quote-phone-link:hover {
    color: #cd8a78;
}

.ts-quote-phone-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ts-quote-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.ts-quote-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ts-quote-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ts-silver, #5a5048);
}

.ts-quote-field label .required {
    color: #c08070;
}

.ts-quote-field label .optional {
    font-weight: 400;
    color: var(--ts-silver-light, #8a7e72);
}

.ts-quote-field input,
.ts-quote-field textarea {
    background: rgba(42, 37, 32, 0.05);
    border: 1px solid rgba(42, 37, 32, 0.06);
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.95rem;
    color: var(--ts-white, #2a2520);
    transition: all 0.3s ease;
}

.ts-quote-field input::placeholder,
.ts-quote-field textarea::placeholder {
    color: var(--ts-silver-light, #8a7e72);
}

.ts-quote-field input:focus,
.ts-quote-field textarea:focus {
    outline: none;
    border-color: rgba(192, 128, 112, 0.5);
    box-shadow: 0 0 0 3px rgba(192, 128, 112, 0.1);
}

.ts-quote-field textarea {
    resize: vertical;
    min-height: 100px;
}

/* Actions */
.ts-quote-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.ts-quote-actions .ts-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ts-quote-actions .ts-btn-outline {
    background: transparent;
    color: var(--ts-silver, #5a5048);
    border: 2px solid rgba(42, 37, 32, 0.15);
}

.ts-quote-actions .ts-btn-outline:hover {
    background: rgba(42, 37, 32, 0.04);
    border-color: rgba(42, 37, 32, 0.25);
}

.ts-quote-actions .ts-btn-primary {
    background: linear-gradient(135deg, #c08070, #cd8a78);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(192, 128, 112, 0.3);
}

.ts-quote-actions .ts-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 128, 112, 0.4);
}

.ts-quote-actions .ts-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.ts-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ts-spin 0.8s linear infinite;
}

@keyframes ts-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Message */
.ts-quote-success {
    padding: 50px 30px;
    text-align: center;
}

.ts-quote-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, rgba(192, 128, 112, 0.2), rgba(192, 128, 112, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c08070;
}

.ts-quote-success h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ts-white, #2a2520);
    margin: 0 0 15px 0;
}

.ts-quote-success p {
    font-size: 0.95rem;
    color: var(--ts-silver, #5a5048);
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.ts-quote-success .ts-btn {
    min-width: 150px;
}

/* Responsive */
@media (max-width: 640px) {
    .ts-quote-modal-container {
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .ts-quote-modal-header,
    .ts-quote-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .ts-quote-row {
        grid-template-columns: 1fr;
    }
    
    .ts-quote-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .ts-quote-actions {
        flex-direction: column-reverse;
    }
    
    .ts-quote-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Opening animations */
.ts-quote-modal.active .ts-quote-modal-overlay {
    animation: ts-fade-in 0.3s ease forwards;
}

.ts-quote-modal.active .ts-quote-modal-container {
    animation: ts-slide-up 0.3s ease forwards;
}

/* Closing animations */
.ts-quote-modal.closing .ts-quote-modal-overlay {
    animation: ts-fade-out 0.25s ease forwards;
}

.ts-quote-modal.closing .ts-quote-modal-container {
    animation: ts-slide-down 0.25s ease forwards;
}

@keyframes ts-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ts-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes ts-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ts-slide-down {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(30px);
    }
}
/* ==========================================================================
   Multi-piece summary list (replaces single-config grid)
   ========================================================================== */

.ts-quote-pieces-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.85rem 0 0;
}

.ts-quote-piece-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--ts-dark-tertiary);
    border-radius: var(--ts-radius-md);
    padding: 0.7rem 0.9rem;
}

.ts-quote-piece-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 60px;
    border-right: 1px solid var(--ts-dark-tertiary);
    padding-right: 0.85rem;
}

.ts-quote-piece-num {
    font-size: 0.78rem;
    color: var(--ts-silver);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.ts-quote-piece-qty {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ts-accent);
    line-height: 1;
}

.ts-quote-piece-specs {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.ts-quote-piece-specs > div:first-child {
    font-size: 0.95rem;
    color: var(--ts-white);
    line-height: 1.3;
}

.ts-quote-piece-specs > div:first-child strong {
    color: var(--ts-white);
    font-weight: 600;
}

.ts-quote-piece-meta {
    font-size: 0.8rem;
    color: var(--ts-silver);
    line-height: 1.4;
}

.ts-quote-piece-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ts-white);
    white-space: nowrap;
}

/* Grand total row */
.ts-quote-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--ts-accent);
    color: #ffffff;
    border-radius: var(--ts-radius-md);
}

.ts-quote-summary-total-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.ts-quote-summary-total-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.015em;
}

/* Spinner for submit button */
.ts-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ts-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

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

/* Mobile tweaks */
@media (max-width: 540px) {
    .ts-quote-piece-card {
        grid-template-columns: auto 1fr;
        gap: 0.65rem;
    }
    .ts-quote-piece-price {
        grid-column: 1 / -1;
        text-align: right;
        padding-top: 0.4rem;
        border-top: 1px solid var(--ts-dark-tertiary);
    }
    .ts-quote-summary-total {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    .ts-quote-summary-total-value {
        font-size: 1.55rem;
    }
}

/* ==========================================================================
   BEGEHBARES GLAS LIGHT-THEME MODAL OVERRIDES
   Original Tanzspiegel modal was dark-themed. Begehbares Glas uses light theme, overrides invert.
   ========================================================================== */

/* Container: light bg with subtle border */
.ts-quote-modal-container {
    background: #ffffff !important;
    border: 1px solid var(--ts-dark-tertiary) !important;
    box-shadow: 0 25px 60px rgba(42, 37, 32, 0.18);
}

/* Header text, dark on light */
.ts-quote-modal-header {
    border-bottom: 1px solid var(--ts-dark-tertiary) !important;
}

.ts-quote-modal-title {
    color: var(--ts-white) !important;  /* var alias: slate-900 in Begehbares Glas */
}

.ts-quote-modal-subtitle {
    color: var(--ts-silver) !important;
}

/* Close button */
.ts-quote-modal-close {
    color: var(--ts-silver) !important;
    background: transparent !important;
}

.ts-quote-modal-close:hover {
    color: var(--ts-accent) !important;
    background: var(--ts-dark-secondary) !important;
}

/* Summary section, light cards */
.ts-quote-summary-title {
    color: var(--ts-white) !important;  /* dark text */
}

.ts-quote-piece-card {
    background: var(--ts-dark-secondary) !important;  /* tinted light */
    border-color: var(--ts-dark-tertiary) !important;
}

.ts-quote-piece-num {
    color: var(--ts-silver) !important;
}

.ts-quote-piece-specs > div:first-child,
.ts-quote-piece-specs > div:first-child strong,
.ts-quote-piece-price {
    color: var(--ts-white) !important;  /* dark text */
}

.ts-quote-piece-meta {
    color: var(--ts-silver) !important;
}

.ts-quote-piece-head {
    border-right-color: var(--ts-dark-tertiary) !important;
}

/* Phone contact banner */
.ts-quote-phone-contact {
    background: var(--ts-dark-secondary) !important;
    border: 1px solid var(--ts-dark-tertiary) !important;
}

.ts-quote-phone-label {
    color: var(--ts-silver) !important;
}

.ts-quote-phone-link {
    color: var(--ts-accent) !important;
}

/* Form fields, light inputs with visible borders */
.ts-quote-form label,
.ts-quote-field label {
    color: var(--ts-white) !important;
    font-weight: 500;
}

.ts-quote-field .required {
    color: var(--ts-accent) !important;
}

.ts-quote-field .optional {
    color: var(--ts-silver) !important;
    font-weight: 400;
}

.ts-quote-field input,
.ts-quote-field textarea,
.ts-quote-form input[type="text"],
.ts-quote-form input[type="email"],
.ts-quote-form input[type="tel"],
.ts-quote-form input[type="number"],
.ts-quote-form textarea {
    background: #ffffff !important;
    color: var(--ts-white) !important;
    border: 1px solid var(--ts-dark-tertiary) !important;
    padding: 0.7rem 0.9rem !important;
    border-radius: var(--ts-radius-md) !important;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ts-quote-field input:focus,
.ts-quote-field textarea:focus,
.ts-quote-form input:focus,
.ts-quote-form textarea:focus {
    outline: none !important;
    border-color: var(--ts-accent) !important;
    box-shadow: 0 0 0 3px rgba(192, 128, 112, 0.12) !important;
}

.ts-quote-field input::placeholder,
.ts-quote-field textarea::placeholder {
    color: var(--ts-silver-light) !important;
}

/* Cancel button, light outline */
.ts-quote-cancel,
.ts-btn-outline {
    background: transparent !important;
    color: var(--ts-silver) !important;
    border: 1px solid var(--ts-dark-tertiary) !important;
}

.ts-quote-cancel:hover {
    background: var(--ts-dark-secondary) !important;
    color: var(--ts-white) !important;
}

/* Success state */
.ts-quote-success h3 {
    color: var(--ts-white) !important;
}

.ts-quote-success p {
    color: var(--ts-silver) !important;
}

.ts-quote-success-icon {
    color: var(--ts-accent) !important;
}

/* Custom dimensions toggle (if visible) */
.ts-quote-custom-toggle label {
    color: var(--ts-white) !important;
}

.ts-quote-note {
    color: var(--ts-silver) !important;
}

/* ==========================================================================
   File upload field, sketches/PDFs (Tony's request)
   ========================================================================== */

.ts-quote-file-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hide native file input, replace with styled label */
.ts-quote-file-wrap input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.ts-quote-file-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #ffffff;
    color: var(--ts-silver);
    border: 1.5px dashed var(--ts-dark-tertiary);
    border-radius: var(--ts-radius-md);
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    min-width: 0;
}

.ts-quote-file-label:hover {
    border-color: var(--ts-accent);
    background: var(--ts-dark-secondary);
    color: var(--ts-accent);
}

.ts-quote-file-label svg {
    flex-shrink: 0;
    color: var(--ts-accent);
}

.ts-quote-file-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* When a file is selected, solid border + sky tint */
.ts-quote-file-wrap.has-file .ts-quote-file-label {
    border-style: solid;
    border-color: var(--ts-accent);
    background: var(--ts-dark-secondary);
    color: var(--ts-white);
}

/* Clear/remove button (× to remove selected file) */
.ts-quote-file-clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--ts-silver);
    border: 1px solid var(--ts-dark-tertiary);
    border-radius: var(--ts-radius-md);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.ts-quote-file-clear:hover {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Hint text below input */
.ts-quote-file-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--ts-silver);
    line-height: 1.4;
}

/* Mobile */
@media (max-width: 540px) {
    .ts-quote-file-label {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
    .ts-quote-file-label svg {
        width: 16px;
        height: 16px;
    }
}
