
/* ==========================================================================
   MOBILE RESPONSIVENESS (MAX-WIDTH: 768px)
   Specific adjustments for Combo Builder and critical components
   ========================================================================== */
@media (max-width: 768px) {
    /* --- Combo Builder Mobile Layout --- */
    .combo-builder {
        border-radius: 1rem;
        margin: 0; /* Align with other mobile cards */
        box-shadow: none; /* Reduce heavy shadow spread if any */
    }

    .combo-controls {
        display: flex;
        flex-direction: column;
        padding: 1.25rem; /* Reduced from 2.5rem */
        gap: 2rem;
    }

    /* Reset grid column span for the base selector wrapper since we use flex now */
    .combo-controls > div[style*="grid-column: 1 / -1"] {
        grid-column: auto !important;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Wrapper was modified entirely in the new wrap section */

    /* Tiers vertical list */
    .tier-list {
        gap: 0.75rem;
    }

    .tier-row {
        padding: 0.75rem 1rem;
    }
    
    .tier-row span:first-child {
        font-size: 0.95rem;
    }

    /* Platform Grid: 2 columns on small screens to preserve touch target size */
    .platform-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: 0.55rem;
    }
    
    /* Make check buttons taller for touch */
    .check-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
        min-height: 3.5rem;
        width: 100%;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
    }

    /* Step Labels */
    .combo-step-label {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    /* Base selector scrollable area */
    .combo-base-selector {
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        /* Ensure horizontal scroll is neat */
        -webkit-overflow-scrolling: touch;
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
        overflow-x: auto;
        display: flex;
        scrollbar-width: none;
    }
    .combo-base-selector::-webkit-scrollbar {
        display: none;
    }

    .selector-btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0; /* Prevent shrinking */
        border-radius: 8px;
    }
    .result-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
        background: rgba(0,0,0,0.8); /* Darker background for contrast at bottom */
    }

    /* Result Bar - Left side (Base included text) */
    .result-bar > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding-bottom: 0.75rem;
    }
    
    #base-includes {
        text-align: right;
        font-size: 0.9rem;
    }

    /* Result Bar - Right side (Price + Button) */
    .result-bar > div:last-child {
        display: flex !important;
        flex-direction: row; 
        justify-content: space-between;
        width: 100%;
        gap: 1rem !important;
        align-items: center;
    }

    /* Price Text */
    #total-price {
        font-size: 1.6rem !important;
        font-weight: 800;
        order: 1;
    }

    /* Add Button with Text */
    .btn-combo-add {
        flex: 1;
        justify-content: center;
        padding: 0.85rem;
        order: 2;
        width: auto;
    }
    
    .btn-combo-add::after {
        content: "AGREGAR";
        margin-left: 0.5rem;
        font-size: 0.9rem;
        font-weight: 700;
        font-family: var(--font-display);
    }

    /* Adjust section titles */
    .section-title {
        font-size: 1.35rem;
        margin-top: 2rem !important;
        padding: 0 1rem; /* Better alignment */
    }
}

/* Very Small Screens (e.g. iPhone SE, Fold) */
@media (max-width: 380px) {
    .platform-grid {
        grid-template-columns: 1fr;
    }
    
    #total-price {
        font-size: 1.4rem !important;
    }
}

@media (min-width: 769px) {
    .combo-builder .platform-grid {
        grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
        gap: 0.65rem;
    }

    .combo-builder .check-btn {
        padding: 0.72rem 0.85rem;
        font-size: 0.84rem;
    }
}

