/* Responsive Styles */

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .masonry-gallery {
        column-count: 4;
    }
}

/* Large devices (desktops, 992px and up) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--navbar-bg);
        padding: 1rem;
        border-radius: 0.5rem;
        box-shadow: var(--shadow-md);
        margin-top: 0.5rem;
    }
    
    .hero-section {
        background-attachment: scroll; /* Disable parallax on smaller devices for performance */
    }
}

/* Medium devices (tablets, 768px and up) */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 85px; /* Prevent bottom navigation bar from covering content */
    }

    .masonry-gallery {
        column-count: 2;
    }
    
    .promo-card {
        height: 250px;
        padding: 1.5rem;
    }
    
    .promo-content h4 {
        font-size: 1.25rem;
    }
    
    .promo-content p {
        font-size: 0.9rem;
    }
    
    .display-1 {
        font-size: 3.5rem;
    }
    
    /* Reposition FABs higher so they don't cover bottom nav */
    .fab-container {
        bottom: 85px !important;
        right: 15px !important;
        gap: 10px !important;
    }
    
    .fab-item {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.1rem !important;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 575.98px) {
    .masonry-gallery {
        column-count: 1;
    }
    
    .display-1 {
        font-size: 2.5rem;
    }
    
    .menu-img-wrapper {
        height: 180px;
    }
}

/* ==========================================================================
   Redesign Mobile Responsive Styles
   ========================================================================== */

@media (max-width: 991.98px) {
    /* Categories Grid to Horizontal Scroll */
    .categories-container {
        display: flex;
        overflow-x: auto;
        padding-bottom: 1rem;
        gap: 1rem;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    .categories-container::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }
    .category-card-custom {
        flex: 0 0 140px;
        scroll-snap-align: start;
    }
    
    /* Recommended Grid to 2 columns */
    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 767.98px) {
    /* Bottom Nav adjustment */
    body {
        padding-bottom: 95px !important; /* Leave space for bottom button */
    }
    
    .mobile-justify-text {
        text-align: justify;
    }

    /* Redesigned Mobile Categories: Circular Icons Row */
    .mobile-circle-categories-wrapper {
        position: relative;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem 0.25rem 1rem 0.25rem;
        margin-bottom: 1rem;
        scrollbar-width: none;
    }
    .mobile-circle-categories-wrapper::-webkit-scrollbar {
        display: none;
    }
    .mobile-circle-categories {
        display: inline-flex;
        gap: 16px;
    }
    .circle-cat-btn {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 0;
        width: 72px;
    }
    .circle-cat-icon-wrapper {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background-color: var(--bg-alt);
        border: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-primary);
        font-size: 1.25rem;
        transition: var(--transition);
        box-shadow: var(--shadow-sm);
        margin-bottom: 8px;
    }
    .circle-cat-btn.active .circle-cat-icon-wrapper {
        background-color: var(--color-primary);
        color: #ffffff;
        border-color: var(--color-primary);
        box-shadow: 0 4px 12px rgba(10, 28, 58, 0.18);
    }
    body.dark-mode .circle-cat-btn.active .circle-cat-icon-wrapper {
        background-color: var(--accent);
        color: #000000;
        border-color: var(--accent);
    }
    .circle-cat-btn.btn-favoritos-circle .circle-cat-icon-wrapper {
        color: #e53e3e;
        border-color: #f56565;
    }
    .circle-cat-btn.btn-favoritos-circle.active .circle-cat-icon-wrapper {
        background-color: #e53e3e;
        color: #ffffff;
        border-color: #e53e3e;
    }
    .circle-cat-label {
        font-size: 0.72rem;
        font-weight: 500;
        color: var(--color-primary);
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
    body.dark-mode .circle-cat-label {
        color: var(--color-text-dark);
    }

    /* Redesigned Recommended List: Vertical Rows (Image left, text right) */
    .recommended-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .recommended-card-custom {
        flex-direction: row;
        height: 100px;
        border-radius: 12px;
    }
    .recommended-img-wrapper {
        width: 100px;
        height: 100%;
        aspect-ratio: 1/1;
        flex-shrink: 0;
    }
    .recommended-body {
        padding: 10px 14px;
        flex-direction: column;
        justify-content: center;
    }
    .recommended-card-title {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }
    .recommended-card-desc {
        font-size: 0.75rem;
        margin-bottom: 6px;
        -webkit-line-clamp: 1;
    }
    .recommended-card-price {
        font-size: 0.9rem;
    }
    .recommended-fav-btn {
        position: relative;
        top: auto;
        right: auto;
        margin-left: auto;
        align-self: center;
        margin-right: 14px;
        box-shadow: none !important;
        background-color: transparent !important;
        width: 32px;
        height: 32px;
    }
    .recommended-fav-btn:hover, .recommended-fav-btn.active {
        color: #e53e3e;
    }

    /* Sticky Bottom Button "Ver Menú Completo" */
    .mobile-sticky-button-container {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 450px;
        z-index: 1040;
    }
    .btn-sticky-bottom {
        width: 100%;
        background-color: var(--color-primary);
        color: #ffffff !important;
        border: none;
        border-radius: 50px;
        padding: 0.8rem 1.5rem;
        font-weight: 600;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        box-shadow: 0 8px 25px rgba(10, 28, 58, 0.25);
        transition: var(--transition);
        text-decoration: none !important;
    }
    .btn-sticky-bottom:hover {
        background-color: #041126;
        transform: translateY(-2px);
    }
    body.dark-mode .btn-sticky-bottom {
        background-color: var(--accent);
        color: #000000 !important;
        box-shadow: 0 8px 25px rgba(233, 159, 56, 0.25);
    }
    body.dark-mode .btn-sticky-bottom:hover {
        background-color: var(--color-accent-hover);
    }
}
