
/* ==========================================================================
   TABLET LANDSCAPE (1024px and below)
   ========================================================================== */
@media (max-width: 1024px) {
    .ts-calculator-design-dashboard {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .ts-price-card-dashboard {
        position: relative;
        top: 0;
    }
    
    /* Optimize segmented controls for tablet */
    .ts-segmented-control {
        gap: 6px;
    }
    
    .ts-segment-option label {
        padding: 0.65rem 0.4rem;
        min-height: 52px;
    }
}

/* ==========================================================================
   TABLET PORTRAIT (900px and below)
   ========================================================================== */
@media (max-width: 900px) {
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        padding: 1.75rem;
    }
    
    .ts-sliders-grid {
        gap: 1.25rem;
    }
    
    .ts-stats-grid-dashboard {
        gap: 0.65rem;
    }
    
    /* Adjust font sizes for better readability */
    .ts-panel-title {
        font-size: 1rem;
    }
    
    .ts-price-big {
        font-size: 2.5rem;
    }
    
    .ts-segment-title {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   MOBILE LANDSCAPE / SMALL TABLET (768px and below)
   ========================================================================== */
@media (max-width: 768px) {
    /* Allow button text to wrap on smaller screens */
    .ts-btn {
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
    
    /* Full-width CTA buttons */
    .ts-gallery-cta .ts-btn,
    .ts-faq-cta .ts-btn {
        width: 100%;
        max-width: 100%;
    }
    
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    /* Single column for sliders */
    .ts-sliders-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Price section adjustments */
    .ts-price-big {
        font-size: 2.25rem;
    }
    
    .ts-price-euro {
        font-size: 1.25rem;
    }
    
    .ts-price-vat {
        font-size: 0.65rem;
    }
    
    /* Stats grid to 2 columns on mobile */
    .ts-stats-grid-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .ts-stat-box {
        padding: 0.75rem;
    }
    
    .ts-stat-value {
        font-size: 1rem;
    }
    
    .ts-stat-label {
        font-size: 0.6rem;
    }
    
    /* Adjust price breakdown */
    .ts-price-line {
        font-size: 0.8rem;
        margin: 0.5rem 0;
    }
    
    .ts-price-line.ts-price-total {
        font-size: 0.9rem;
    }
    
    /* Segmented controls - better mobile layout */
    .ts-segmented-control {
        padding: 3px;
        gap: 3px;
    }
    
    .ts-segment-option label {
        padding: 0.65rem 0.35rem;
        min-height: 50px;
    }
    
    .ts-segment-title {
        font-size: 0.72rem;
    }
    
    .ts-segment-price {
        font-size: 0.62rem;
    }
    
    /* Grid layouts - 2 columns for mounting */
    .ts-segmented-control.ts-segmented-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Mirror types - if more than 4, use 2 columns */
    .ts-segmented-control.ts-segmented-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hide sliding indicator on mobile, use background instead */
    .ts-segmented-indicator {
        display: none !important;
    }
    
    .ts-segment-option input[type="radio"]:checked + label {
        background: linear-gradient(135deg, #e84393, #d63384);
        box-shadow: 0 2px 8px rgba(232, 67, 147, 0.4);
    }
    
    /* Action buttons */
    .ts-calculator-actions {
        gap: 0.6rem;
    }
    
    .ts-calculator-actions .ts-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   MOBILE PORTRAIT (640px and below)
   ========================================================================== */
@media (max-width: 640px) {
    /* ==========================================================================
       MOBILE BUTTON TEXT WRAPPING FIX
       ========================================================================== */
    
    /* Allow text wrapping on mobile for all buttons */
    .ts-btn {
        white-space: normal !important;
        text-align: center;
        line-height: 1.4;
    }
    
    /* Gallery CTA button */
    .ts-gallery-cta .ts-btn {
        max-width: 100%;
        width: 100%;
        padding: 1rem 1.5rem;
    }
    
    /* FAQ CTA button */
    .ts-faq-cta .ts-btn,
    .ts-faq-cta .ts-btn-secondary {
        max-width: 100%;
        width: 100%;
        padding: 1rem 1.25rem;
    }
    
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        padding: 1.25rem;
        border-radius: 14px;
    }
    
    /* Reduce gaps */
    .ts-calculator-design-dashboard {
        gap: 20px;
    }
    
    .ts-panel-header {
        margin-bottom: 1rem;
        padding-bottom: 0.85rem;
    }
    
    .ts-panel-title {
        font-size: 0.95rem;
    }
    
    .ts-panel-title svg {
        width: 18px;
        height: 18px;
    }
    
    /* Input sections */
    .ts-input-row-dashboard {
        margin-bottom: 0.85rem;
    }
    
    .ts-segmented-group {
        margin-bottom: 1rem;
    }
    
    .ts-input-label,
    .ts-segmented-label {
        font-size: 0.72rem;
        margin-bottom: 0.4rem;
    }
    
    .ts-input-value-dashboard {
        font-size: 1.15rem;
        margin-top: 0.2rem;
    }
    
    /* Sliders */
    .ts-range-input {
        height: 4px;
        margin: 0.6rem 0;
    }
    
    .ts-range-input::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    
    .ts-range-input::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }
    
    /* Segmented controls - compact */
    .ts-segment-option label {
        padding: 0.6rem 0.3rem;
        min-height: 48px;
    }
    
    .ts-segment-title {
        font-size: 0.68rem;
        line-height: 1.3;
    }
    
    .ts-segment-price {
        font-size: 0.6rem;
        margin-top: 1px;
    }
    
    /* Price section */
    .ts-price-tag {
        font-size: 0.72rem;
        margin-bottom: 0.6rem;
    }
    
    .ts-price-big {
        font-size: 2rem;
        margin-bottom: 0.4rem;
    }
    
    .ts-price-euro {
        font-size: 1.1rem;
    }
    
    .ts-price-vat {
        font-size: 0.62rem;
        margin-bottom: 1rem;
    }
    
    .ts-price-details-dashboard {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .ts-price-line {
        font-size: 0.75rem;
        margin: 0.45rem 0;
    }
    
    .ts-price-line span {
        padding-right: 0.5rem;
    }
    
    .ts-price-line.ts-price-total {
        font-size: 0.85rem;
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }
    
    /* Stats grid */
    .ts-stats-grid-dashboard {
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .ts-stat-box {
        padding: 0.7rem 0.5rem;
        border-radius: 6px;
    }
    
    .ts-stat-value {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }
    
    .ts-stat-label {
        font-size: 0.58rem;
    }
    
    /* Action buttons */
    .ts-calculator-actions {
        margin-top: 1rem;
        gap: 0.5rem;
    }
    
    .ts-calculator-actions .ts-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    
    .ts-calculator-actions .ts-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ==========================================================================
   SMALL MOBILE (480px and below)
   ========================================================================== */
@media (max-width: 480px) {
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .ts-calculator-design-dashboard {
        gap: 16px;
    }
    
    /* Further reduce font sizes */
    .ts-panel-title {
        font-size: 0.9rem;
        gap: 0.4rem;
    }
    
    .ts-panel-title svg {
        width: 16px;
        height: 16px;
    }
    
    .ts-input-label,
    .ts-segmented-label {
        font-size: 0.68rem;
    }
    
    .ts-input-value-dashboard {
        font-size: 1.05rem;
    }
    
    /* Segmented controls - very compact */
    .ts-segmented-control {
        padding: 2px;
        gap: 2px;
        border-radius: 10px;
    }
    
    .ts-segment-option label {
        padding: 0.55rem 0.25rem;
        min-height: 46px;
        border-radius: 8px;
    }
    
    .ts-segment-title {
        font-size: 0.65rem;
        line-height: 1.3;
    }
    
    .ts-segment-price {
        font-size: 0.58rem;
    }
    
    /* Price section - compact */
    .ts-price-big {
        font-size: 1.85rem;
    }
    
    .ts-price-euro {
        font-size: 1rem;
    }
    
    .ts-price-line {
        font-size: 0.72rem;
        line-height: 1.4;
    }
    
    .ts-price-line.ts-price-total {
        font-size: 0.8rem;
    }
    
    /* Stats - single column on very small screens */
    .ts-stats-grid-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.45rem;
    }
    
    .ts-stat-box {
        padding: 0.65rem 0.4rem;
    }
    
    .ts-stat-value {
        font-size: 0.9rem;
    }
    
    .ts-stat-label {
        font-size: 0.55rem;
    }
    
    /* Buttons - stack vertically if needed */
    .ts-calculator-actions .ts-btn {
        padding: 0.7rem 0.85rem;
        font-size: 0.8rem;
        gap: 0.4rem;
    }
    
    .ts-calculator-actions .ts-btn svg {
        width: 15px;
        height: 15px;
    }
}

/* ==========================================================================
   EXTRA SMALL MOBILE (360px and below)
   ========================================================================== */
@media (max-width: 360px) {
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        padding: 0.85rem;
    }
    
    .ts-panel-header {
        margin-bottom: 0.85rem;
        padding-bottom: 0.75rem;
    }
    
    .ts-panel-title {
        font-size: 0.85rem;
    }
    
    /* Segmented controls - minimal */
    .ts-segment-option label {
        padding: 0.5rem 0.2rem;
        min-height: 44px;
    }
    
    .ts-segment-title {
        font-size: 0.62rem;
    }
    
    .ts-segment-price {
        font-size: 0.55rem;
    }
    
    /* Price */
    .ts-price-big {
        font-size: 1.65rem;
    }
    
    .ts-price-line {
        font-size: 0.68rem;
    }
    
    .ts-stat-value {
        font-size: 0.85rem;
    }
    
    .ts-stat-label {
        font-size: 0.52rem;
    }
    
    .ts-calculator-actions .ts-btn {
        padding: 0.65rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   LANDSCAPE MODE SPECIFIC (height-based)
   ========================================================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .ts-price-card-dashboard {
        position: relative;
        top: 0;
    }
    
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        padding: 1rem;
    }
    
    .ts-panel-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .ts-segmented-group {
        margin-bottom: 0.85rem;
    }
    
    .ts-input-row-dashboard {
        margin-bottom: 0.75rem;
    }
    
    .ts-stats-grid-dashboard {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        margin-top: 0.85rem;
    }
    
    .ts-calculator-actions {
        margin-top: 0.85rem;
    }
}

/* ==========================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for mobile */
    .ts-segment-option label {
        min-height: 48px;
    }
    
    .ts-range-input::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    .ts-range-input::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
    
    .ts-calculator-actions .ts-btn {
        min-height: 44px;
    }
}

/* ==========================================================================
   HIGH DPI DISPLAYS (Retina)
   ========================================================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ts-segmented-control,
    .ts-segment-option label {
        border-width: 0.5px;
    }
    
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        border-width: 0.5px;
    }
}

/* ==========================================================================
   PRINT STYLES (Optional - for quote printing)
   ========================================================================== */
@media print {
    .ts-calculator-design-dashboard {
        grid-template-columns: 1fr;
    }
    
    .ts-calculator-actions {
        display: none;
    }
    
    .ts-config-panel-dashboard,
    .ts-price-card-dashboard {
        background: white;
        color: black;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}
/* ==========================================================================
   VAT LINE STYLING (text only, no amount)
   ========================================================================== */
.ts-price-vat-line {
    font-style: italic;
    opacity: 0.8;
}

.ts-price-vat-line strong {
    display: none; /* Hide the empty strong element */
}