/* ===== MOBILE-FIRST SIMPLIFIED VIEW ===== */
/* Optimiert für einfache Bedienung auf Smartphones */

/* Default: Hide mobile elements on all screens */
.mobile-config-header,
.mobile-footer {
    display: none;
}

@media (max-width: 768px) {
    /* ===== BODY & LAYOUT RESET ===== */
    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0;
        margin: 0;
    }

    /* Prevent horizontal scroll everywhere */
    html {
        overflow-x: hidden !important;
    }

    *, *::before, *::after {
        max-width: 100vw;
    }

    /* ===== HIDE SIDEBARS COMPLETELY ===== */
    #price-overview,
    #system-config,
    #toggle-price-overview,
    #toggle-system-config {
        display: none !important;
    }

    /* Remove sidebar padding from step */
    .step {
        padding: 0 !important;
        margin: 0 !important;
        flex-direction: column;
        min-height: 0;
        overflow-x: hidden !important;
    }

    #main-content {
        margin: 0 !important;
        padding: 0 0.75rem 7.5rem !important;
        width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }

    /* ===== MOBILE CONFIG HEADER ===== */
    .mobile-config-header {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
        background: linear-gradient(180deg, rgba(20, 20, 32, 0.98) 0%, rgba(28, 28, 46, 0.95) 100%);
        border-bottom: 1px solid rgba(127, 133, 228, 0.2);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mobile-config-header h2 {
        display: none;
    }

    .mobile-config-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        align-items: center;
    }

    .mobile-config-item {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1;
        min-width: 100px;
        max-width: 150px;
    }

    .mobile-config-item label {
        font-size: 0.7rem;
        color: #9098b0;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-config-item select {
        font-size: 0.85rem;
        padding: 0.5rem 1.8rem 0.5rem 0.6rem;
        background-size: 10px;
        border-radius: 8px;
    }

    /* ===== PAGE TITLE ===== */
    .h2-banner {
        padding: 0.75rem 0.5rem;
        text-align: center;
        width: 100%;
    }

    .h2-banner h2 {
        font-size: clamp(1.3rem, 5vw, 1.8rem) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        position: static !important;
        left: auto !important;
        transform: none !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* ===== PRODUCT LIST - SIMPLIFIED ===== */
    #produkteList {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 0;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* ===== PRODUCT CARDS - TOUCH OPTIMIZED ===== */
    .produkt-block {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 1rem 0.9rem 2.5rem;
        border-radius: 12px;
        min-height: 0 !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .produkt-block:hover {
        transform: none;
    }

    .produkt-block.selected {
        border-width: 2px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 2px rgba(127, 133, 228, 0.3);
    }

    /* Larger selection indicator for touch */
    .produkt-block::before {
        width: 28px;
        height: 28px;
        top: 0.75rem;
        right: 0.75rem;
    }

    .produkt-block label {
        font-size: clamp(1.1rem, 4vw, 1.3rem);
        padding-right: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .product-description {
        font-size: 13px;
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Hide decorative icons on mobile */
    .Icon-block {
        display: none !important;
    }

    /* ===== CONTROLS - TOUCH FRIENDLY ===== */
    .user-controls,
    .custom-controls {
        gap: 0.75rem;
    }

    .control-group,
    .checkbox-control-group {
        padding: 0.75rem;
        gap: 0.5rem;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .control-group label,
    .checkbox-control-group label,
    .user-controls label,
    .custom-controls label {
        font-size: 0.9rem;
        text-align: center;
    }

    /* ===== HIDE SLIDERS ON MOBILE - Use +/- buttons only ===== */
    .control-group input[type="range"],
    .features-controls .control-group input[type="range"],
    .user-controls input[type="range"],
    .custom-controls input[type="range"] {
        display: none !important;
    }

    /* Center the +/- button group */
    .control-group,
    .user-controls .control-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Style for value display that was next to slider */
    .control-group span[id$="-value"],
    .slider-value {
        display: none !important;
    }

    /* Number inputs - larger and centered */
    .control-group input[type="number"] {
        width: 100px;
        font-size: 1.1rem;
        padding: 0.75rem;
        text-align: center;
        border-radius: 8px;
    }

    /* +/- Buttons styling */
    .control-group button,
    .increment-btn,
    .decrement-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }

    /* Checkboxes - larger touch area */
    .checkbox-control-group input[type="checkbox"] {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    /* Features grid to single column */
    .features-controls {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .features-controls > div {
        padding: 0.75rem;
        min-height: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .product-subheading {
        font-size: 1rem;
        text-align: center;
    }

    /* Center the underline on Features headings */
    .product-subheading::after {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 60% !important;
    }

    .features-controls .product-subheading::after {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 80% !important;
    }

    /* Hide slider min/max labels (e.g., "1" and "100K") */
    .slider-minmax {
        display: none !important;
    }

    /* ===== PRODUCT PRICE TAG ===== */
    .product-price {
        position: relative;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        margin-top: 0.75rem;
        text-align: center;
        padding: 0.6rem;
    }

    /* ===== MOBILE FOOTER - FIXED BOTTOM ===== */
    .mobile-footer {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: linear-gradient(180deg, rgba(20, 20, 32, 0.98) 0%, rgba(12, 12, 19, 1) 100%);
        border-top: 1px solid rgba(127, 133, 228, 0.25);
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.5rem;
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }

    .mobile-footer-price {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        font-size: 1rem;
    }

    .mobile-footer-price .price-label {
        color: #a0a4b8;
        font-weight: 500;
    }

    .mobile-footer-price .price-value {
        background: linear-gradient(135deg, #7f85e4 0%, #a89fef 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        font-weight: 700;
        font-size: 1.2rem;
    }

    .mobile-footer-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }

    .mobile-footer-btn {
        flex: 1;
        max-width: 160px;
        padding: 0.75rem 1rem;
        border: none;
        border-radius: 10px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        transition: all 0.2s ease;
    }

    .mobile-footer-btn svg {
        width: 18px;
        height: 18px;
    }

    .mobile-footer-btn.primary {
        background: linear-gradient(135deg, #7f85e4 0%, #6a70d4 100%);
        color: #ffffff;
    }

    .mobile-footer-btn.primary:active {
        transform: scale(0.98);
    }

    .mobile-footer-btn.secondary {
        background: rgba(127, 133, 228, 0.15);
        color: #e0e4f0;
        border: 1px solid rgba(127, 133, 228, 0.3);
    }

    /* ===== HIDE DESKTOP ELEMENTS ===== */
    .total-price,
    .quote,
    #quote-container,
    #total-price-container {
        display: none !important;
    }

    /* Quick nav hidden on mobile - not needed */
    .quick-nav,
    .product-quick-nav {
        display: none !important;
    }

    /* ===== TRANSACTION CONTROLS ===== */
    .transaction-control:not(.hidden) {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* ===== MODAL ADJUSTMENTS ===== */
    .modal-overlay {
        padding: 1rem;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .mobile-config-item {
        min-width: 80px;
        flex: 1 1 45%;
    }

    .mobile-config-item select {
        font-size: 0.8rem;
        padding: 0.4rem 1.5rem 0.4rem 0.5rem;
    }

    .produkt-block {
        padding: 0.85rem 0.75rem 2.2rem;
    }

    .produkt-block label {
        font-size: 1rem;
    }

    .mobile-footer {
        padding: 0.6rem;
    }

    .mobile-footer-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-config-header {
        padding: 0.5rem 0.75rem;
    }

    .mobile-config-row {
        flex-wrap: nowrap;
    }

    .mobile-config-item {
        max-width: none;
    }

    #main-content {
        padding-bottom: 5rem !important;
    }

    .mobile-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
    }

    .mobile-footer-price {
        flex: 1;
    }

    .mobile-footer-actions {
        flex: 0 0 auto;
    }
}

/* Desktop: Hide mobile-specific elements */
@media (min-width: 769px) {
    .mobile-config-header,
    .mobile-footer {
        display: none !important;
    }
}
