/* =====================================================
   RESPONSIVE MOBILE - Comprehensive Mobile Optimizations
   Leskovački Kutak - 2025 Mobile-First Redesign
   ===================================================== */

/* =====================================================
   GLOBAL MOBILE IMPROVEMENTS
   ===================================================== */

/* Smoother touch interactions */
@media (max-width: 991px) {
    * {
        -webkit-tap-highlight-color: rgba(255, 107, 53, 0.15);
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Better scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Improve readability */
    body {
        font-size: 16px;
        line-height: 1.6;
        overflow-x: hidden;
    }
    
    /* CRITICAL: Prevent horizontal overflow */
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
        position: relative;
    }
    
    /* Hide all horizontal scrollbars on mobile */
    *::-webkit-scrollbar:horizontal {
        display: none;
        height: 0;
    }
    
    /* Ensure sections don't overflow */
    section, .section, main, article, aside, footer, header {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Global text overflow prevention */
    h1, h2, h3, h4, h5, h6, p, span, a, li, td, th {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Ensure all icons are centered properly */
    i, .fa, .fas, .far, .fab, [class^="fa-"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        vertical-align: middle;
    }
    
    /* Prevent images from breaking layout */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* All flex icon containers should center */
    [class*="__icon"] {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    
    /* Hide ALL scrollbars on mobile for better UX */
    * {
        -ms-overflow-style: none;  /* IE and Edge */
    }
    
    *::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
}

/* =====================================================
   CONTAINER & LAYOUT - Mobile Padding
   ===================================================== */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Prevent any element from causing horizontal scroll */
    section, div, article, aside, main {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Additional overflow prevention for common problem areas */
    .row, .grid, [class*="row"], [class*="grid"] {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
    
    /* Force all fixed widths to be responsive */
    table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        -ms-overflow-style: none;
    }
    
    table::-webkit-scrollbar {
        display: none;
    }
    
    /* Ensure images don't break layout */
    img, video, iframe, canvas, svg {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* =====================================================
   HEADER - Mobile Enhancements
   ===================================================== */
@media (max-width: 991px) {
    .header {
        padding: 10px 0;
    }
    
    .header__container {
        padding: 0 12px;
    }
    
    .header__inner {
        gap: 12px;
    }
    
    .header__logo {
        gap: 8px;
    }
    
    .header__logo-img {
        width: 38px;
        height: 38px;
    }
    
    .header__logo-text {
        font-size: 1rem;
    }
    
    /* Mobile cart button - make larger touch target */
    .header__cart-btn {
        padding: 8px 12px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header__cart-btn i {
        font-size: 1.1rem;
    }
    
    .header__cart-count {
        top: -4px;
        right: -4px;
        min-width: 18px;
        height: 18px;
        font-size: 0.65rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile menu improvements */
    .header__nav {
        width: 80%;
        max-width: 300px;
    }
    
    .header__nav a {
        padding: 14px 18px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header__nav a i {
        width: 20px;
        text-align: center;
        color: var(--primary);
        font-size: 1rem;
    }
    
    .header__actions {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .header__logo-text {
        font-size: 0.9rem;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header__logo-img {
        width: 34px;
        height: 34px;
    }
    
    .header__cart-btn {
        padding: 6px 10px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .header__cart-btn i {
        font-size: 1rem;
    }
}

@media (max-width: 375px) {
    .header__logo-text {
        display: none;
    }
    
    .header__logo-img {
        width: 36px;
        height: 36px;
    }
}

/* =====================================================
   HERO SECTION - Mobile Optimizations
   ===================================================== */
@media (max-width: 768px) {
    .hero {
        min-height: calc(100vh - 60px);
        min-height: calc(100dvh - 60px);
        padding-top: 70px;
        padding-bottom: 30px;
    }
    
    .hero__container {
        padding: 0 16px;
    }
    
    .hero__content {
        padding: 20px 0;
    }
    
    .hero__badge {
        padding: 10px 18px;
        font-size: 0.75rem;
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .hero__badge i {
        font-size: 0.9rem;
    }
    
    .hero__title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: 16px;
        line-height: 1.15;
    }
    
    .hero__text {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 24px;
        opacity: 0.9;
    }
    
    .hero__buttons {
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .hero__buttons .btn {
        padding: 14px 24px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }
    
    .hero__buttons .btn i {
        font-size: 1rem;
    }
    
    .hero__stats {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero__stat {
        min-width: 80px;
        text-align: center;
    }
    
    .hero__stat-number {
        font-size: 1.6rem;
    }
    
    .hero__stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding-top: 70px;
    }
    
    .hero__title {
        font-size: 1.75rem;
    }
    
    .hero__text {
        font-size: 0.95rem;
    }
    
    .hero__buttons .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .hero__stats {
        gap: 16px;
    }
    
    .hero__stat-number {
        font-size: 1.4rem;
    }
}

/* =====================================================
   SECTIONS - Mobile Spacing
   ===================================================== */
@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }
    
    .section-header {
        margin-bottom: 30px;
        padding: 0 8px;
    }
    
    .section-badge {
        padding: 8px 16px;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
    
    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
        gap: 10px;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-top: 12px;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 24px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
}

/* =====================================================
   GRID SYSTEM - Mobile Improvements
   ===================================================== */
@media (max-width: 768px) {
    .grid--2,
    .grid--3,
    .grid--4,
    .grid--5,
    .grid--6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .grid--2,
    .grid--3,
    .grid--4,
    .grid--5,
    .grid--6 {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    /* For product grids - keep 2 columns on small mobile */
    .products-grid,
    .grid--products {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 375px) {
    .products-grid,
    .grid--products {
        gap: 10px;
    }
}

/* =====================================================
   PRODUCT CARDS - Mobile Horizontal Layout
   ===================================================== */
@media (max-width: 768px) {
    .product-card {
        border-radius: 16px;
        display: flex;
        flex-direction: row;
        height: auto;
    }
    
    .product-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    
    .product-card__image {
        flex: 0 0 120px;
        width: 120px;
        height: auto;
        min-height: 120px;
        aspect-ratio: 1 / 1;
        padding-bottom: 0;
        border-radius: 16px 0 0 16px;
    }
    
    .product-card__image img {
        border-radius: 16px 0 0 16px;
        height: 100%;
        object-fit: cover;
    }
    
    .product-card__image::after {
        display: none;
    }
    
    .product-card__body {
        flex: 1;
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-width: 0;
    }
    
    .product-card__badges {
        top: 8px;
        left: 8px;
        gap: 4px;
    }
    
    .product-card__badge {
        padding: 3px 8px;
        font-size: 0.6rem;
    }
    
    .product-card__meta {
        margin-bottom: 4px;
        gap: 8px;
    }
    
    .product-card__shop {
        font-size: 0.7rem;
    }
    
    .product-card__category {
        font-size: 0.65rem;
        display: none;
    }
    
    .product-card__weight {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    .product-card__name {
        font-size: 0.9rem;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
    }
    
    .product-card__desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
        min-height: 0;
        display: -webkit-box;
        color: var(--text-muted);
    }
    
    .product-card__footer {
        padding-top: 8px;
        border-top: none;
        margin-top: auto;
    }
    
    .product-card__price {
        font-size: 1rem;
    }
    
    /* Add button on mobile */
    .product-card__add,
    .product-card__select-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .product-card__image {
        flex: 0 0 100px;
        width: 100px;
        min-height: 100px;
    }
    
    .product-card__body {
        padding: 10px;
    }
    
    .product-card__name {
        font-size: 0.85rem;
    }
    
    .product-card__desc {
        font-size: 0.7rem;
        -webkit-line-clamp: 2;
    }
    
    .product-card__price {
        font-size: 0.95rem;
    }
    
    .product-card__select-btn {
        padding: 6px 12px;
        gap: 4px;
    }
    
    .product-card__select-btn span {
        display: none;
    }
}

@media (max-width: 375px) {
    .product-card {
        border-radius: 12px;
    }
    
    .product-card__body {
        padding: 10px;
    }
    
    .product-card__name {
        font-size: 0.8rem;
    }
    
    .product-card__price {
        font-size: 0.9rem;
    }
}

/* =====================================================
   ADDONS PANEL - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .product-card__addons-inner {
        padding: 14px;
    }
    
    .addon-category {
        margin-bottom: 14px;
    }
    
    .addon-category__title {
        font-size: 0.85rem;
    }
    
    .addon-items {
        gap: 6px;
    }
    
    .addon-item {
        padding: 8px 12px;
        gap: 6px;
        flex: 0 1 auto;
    }
    
    .addon-item__checkbox,
    .addon-item__radio {
        width: 16px;
        height: 16px;
    }
    
    .addon-item__name {
        font-size: 0.8rem;
    }
    
    .addon-item__price {
        font-size: 0.75rem;
    }
    
    /* Cart section in addons */
    .product-card__cart-section {
        flex-direction: column;
        gap: 10px;
        margin-top: 14px;
        padding-top: 14px;
    }
    
    .product-card__total-price {
        font-size: 1.1rem;
    }
    
    .product-card__add-btn {
        padding: 12px 20px;
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
    }
}

/* =====================================================
   MENU PAGE - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .menu-hero {
        min-height: 220px;
        padding-top: 70px;
    }
    
    .menu-hero__content {
        padding: 20px 16px;
    }
    
    .menu-hero__badge {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 16px;
    }
    
    .menu-hero__title {
        font-size: 1.75rem;
        margin-bottom: 10px;
    }
    
    .menu-hero__subtitle {
        font-size: 1rem;
        display: none;
    }
    
    /* Category Navigation - Horizontal scroll */
    .category-nav {
        top: 58px;
        padding: 10px 0;
        margin-bottom: 24px;
    }
    
    .category-nav__inner {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        padding: 4px 12px;
        scroll-snap-type: x mandatory;
    }
    
    .category-pill {
        padding: 10px 14px;
        font-size: 0.8rem;
        gap: 6px;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    
    .category-pill i {
        font-size: 1rem;
    }
    
    /* Category sections */
    .category-section {
        margin-bottom: 40px;
        scroll-margin-top: 120px;
    }
    
    .category-section__header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .category-section__icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .category-section__title {
        font-size: 1.3rem;
    }
    
    .category-section__count {
        margin-left: auto;
        font-size: 0.8rem;
        padding: 4px 10px;
    }
    
    /* Search bar */
    .search-bar {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .search-bar__input {
        min-width: 100%;
    }
    
    .search-bar__input input {
        padding: 12px 14px 12px 42px;
    }
    
    .search-bar__select {
        width: 100%;
    }
    
    .search-bar__select select {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .menu-hero {
        min-height: 180px;
    }
    
    .menu-hero__title {
        font-size: 1.5rem;
    }
    
    .category-nav {
        top: 54px;
    }
    
    .category-pill {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .category-section__title {
        font-size: 1.15rem;
    }
}

/* =====================================================
   CART PAGE - Mobile
   ===================================================== */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .checkout-summary {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .cart-page {
        padding: 30px 0;
    }
    
    .cart-hero {
        min-height: 150px;
        padding-top: 70px;
    }
    
    .cart-hero__content {
        padding: 24px 16px;
    }
    
    .cart-hero__badge {
        padding: 6px 14px;
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .cart-hero__title {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    
    .cart-hero__subtitle {
        font-size: 0.95rem;
    }
    
    /* Cart sections */
    .cart-section {
        border-radius: 16px;
    }
    
    .cart-section__header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-section__title {
        font-size: 1.1rem;
    }
    
    .cart-section__body {
        padding: 16px;
    }
    
    /* Cart items */
    .cart-item {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px 0;
    }
    
    .cart-item__image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item__info {
        flex: 1;
        min-width: 0;
    }
    
    .cart-item__name {
        font-size: 0.95rem;
    }
    
    .cart-item__shop {
        font-size: 0.8rem;
    }
    
    .cart-item__addons span {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    
    .cart-item__actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed rgba(255, 255, 255, 0.1);
    }
    
    .cart-item__price {
        font-size: 1rem;
    }
    
    /* Quantity control */
    .quantity-control button {
        width: 32px;
        height: 32px;
    }
    
    .quantity-control span {
        width: 36px;
        font-size: 0.9rem;
    }
    
    /* Checkout summary */
    .checkout-summary {
        border-radius: 16px;
    }
    
    .checkout-summary__header {
        padding: 18px 20px;
    }
    
    .checkout-summary__title {
        font-size: 1.15rem;
    }
    
    .checkout-summary__body {
        padding: 20px;
    }
    
    .summary-row {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .summary-row--total {
        font-size: 1.15rem;
        padding-top: 16px;
        margin-top: 16px;
    }
    
    .checkout-summary__footer {
        padding: 0 20px 20px;
    }
    
    .checkout-summary__btn {
        padding: 16px;
        font-size: 1rem;
    }
    
    /* Delivery type */
    .delivery-type-section {
        padding: 18px;
        margin-bottom: 18px;
    }
    
    .delivery-type-section h3 {
        font-size: 1rem;
        margin-bottom: 14px;
    }
    
    .delivery-type-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .delivery-type-option {
        padding: 14px 16px;
    }
    
    .delivery-type-option__icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .delivery-type-option__title {
        font-size: 0.95rem;
    }
    
    .delivery-type-option__desc {
        font-size: 0.8rem;
    }
    
    /* Shop selection */
    .shop-card {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .shop-card__icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .shop-card__name {
        font-size: 1rem;
    }
    
    .shop-card__address {
        font-size: 0.85rem;
    }
    
    .shop-card__phone {
        font-size: 0.8rem;
    }
    
    /* Delivery time options */
    .delivery-time-options {
        grid-template-columns: 1fr;
    }
    
    .delivery-time-option {
        padding: 14px;
    }
    
    .delivery-time-option__icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* Empty cart */
    .cart-empty {
        padding: 40px 16px;
    }
    
    .cart-empty__icon {
        font-size: 4rem;
    }
    
    .cart-empty__title {
        font-size: 1.25rem;
    }
    
    .cart-empty__text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cart-hero__title {
        font-size: 1.3rem;
    }
    
    .cart-section__header {
        padding: 14px;
    }
    
    .cart-section__body {
        padding: 14px;
    }
    
    .cart-item__image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item__name {
        font-size: 0.9rem;
    }
}

/* =====================================================
   FOOTER - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .footer {
        padding: 3rem 0 0;
    }
    
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer__brand {
        align-items: center;
    }
    
    .footer__logo {
        justify-content: center;
    }
    
    .footer__description {
        max-width: 100%;
    }
    
    .footer__social {
        justify-content: center;
    }
    
    .footer__column {
        align-items: center;
    }
    
    .footer__list {
        align-items: center;
    }
    
    .footer__link:hover {
        transform: none;
    }
    
    /* Footer bottom */
    .footer__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem 0;
    }
    
    .footer__bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2rem 0 0;
    }
    
    .footer__grid {
        gap: 1.5rem;
    }
    
    .footer__title {
        font-size: 1rem;
    }
    
    .footer__link {
        font-size: 0.9rem;
    }
    
    .footer__social-link {
        width: 40px;
        height: 40px;
    }
}

/* =====================================================
   BUTTONS - Mobile Touch Targets
   ===================================================== */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .btn--sm {
        min-height: 36px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .btn--lg {
        min-height: 50px;
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .btn i {
        font-size: inherit;
    }
}

/* =====================================================
   FORMS - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 10px;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* =====================================================
   MODALS - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .modal__content {
        width: 95%;
        max-width: 400px;
        max-height: 90vh;
        margin: auto;
        border-radius: 20px;
    }
    
    .modal__header {
        padding: 16px 20px;
    }
    
    .modal__title {
        font-size: 1.15rem;
    }
    
    .modal__body {
        padding: 16px 20px;
    }
    
    .modal__footer {
        padding: 16px 20px;
        gap: 10px;
    }
    
    .modal__footer .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .modal__content {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(0);
    }
}

/* =====================================================
   TOASTS - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 80px;
    }
    
    .toast {
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: 12px;
    }
}

/* =====================================================
   CTA SECTION - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .cta-section {
        padding: 50px 0;
    }
    
    .cta-content {
        padding: 30px 20px;
        text-align: center;
    }
    
    .cta-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .cta-text {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
}

/* =====================================================
   FEATURES SECTION - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .feature-card {
        padding: 24px 20px;
        text-align: center;
    }
    
    .feature-card__icon {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
        margin: 0 auto 16px;
    }
    
    .feature-card__title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .feature-card__desc {
        font-size: 0.9rem;
    }
}

/* =====================================================
   APP PROMO SECTION - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .app-promo {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .app-promo__content {
        order: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .app-promo__content .section-badge {
        margin: 0 auto 16px;
    }
    
    .app-promo__visual {
        order: 2;
    }
    
    .app-promo__title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .app-promo__text {
        font-size: 0.95rem;
        text-align: center;
    }
    
    .app-promo__features {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0;
        list-style: none;
    }
    
    .app-promo__features li {
        text-align: center;
        justify-content: center;
    }
    
    .app-promo__buttons {
        justify-content: center;
    }
    
    #installAppBtn {
        width: 100%;
        max-width: 280px;
    }
}

/* =====================================================
   LOCATIONS PAGE - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .location-card {
        padding: 20px;
    }
    
    .location-card__icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .location-card__name {
        font-size: 1.15rem;
    }
    
    .location-card__address {
        font-size: 0.9rem;
    }
    
    .location-card__hours {
        font-size: 0.85rem;
    }
}

/* =====================================================
   FEATURED PRODUCTS - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .featured-products {
        padding: 50px 0;
    }
    
    .featured-products .grid--3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .featured-products .grid--3 {
        gap: 12px;
    }
}

/* =====================================================
   CATEGORIES GRID - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-card {
        padding: 20px 16px;
    }
    
    .category-card__icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
        margin-bottom: 12px;
    }
    
    .category-card__name {
        font-size: 0.95rem;
    }
    
    .category-card__count {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        gap: 10px;
    }
    
    .category-card {
        padding: 16px 12px;
    }
    
    .category-card__icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .category-card__name {
        font-size: 0.85rem;
    }
}

/* =====================================================
   ORDERS PAGE - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .order-card {
        padding: 16px;
        border-radius: 14px;
    }
    
    .order-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-card__id {
        font-size: 0.9rem;
    }
    
    .order-card__status {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .order-card__items {
        font-size: 0.85rem;
    }
    
    .order-card__footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .order-card__total {
        font-size: 1.1rem;
    }
    
    .order-card__actions {
        display: flex;
        gap: 8px;
    }
    
    .order-card__actions .btn {
        flex: 1;
    }
}

/* =====================================================
   LANDSCAPE MODE OPTIMIZATIONS
   ===================================================== */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: 0;
        padding: 80px 0 40px;
    }
    
    .hero__title {
        font-size: 1.6rem;
    }
    
    .hero__text {
        display: none;
    }
    
    .hero__buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .hero__buttons .btn {
        width: auto;
        flex: 1;
        min-width: 150px;
    }
    
    .hero__stats {
        margin-top: 20px;
    }
    
    .section {
        padding: 30px 0;
    }
    
    .menu-hero {
        min-height: 120px;
    }
    
    .cart-hero {
        min-height: 100px;
    }
}

/* =====================================================
   SAFE AREAS FOR NOTCHED DEVICES
   ===================================================== */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    .footer__bottom {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    
    .modal__content {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .toast-container {
        bottom: max(80px, calc(env(safe-area-inset-bottom) + 60px));
    }
}

/* =====================================================
   REDUCED MOTION
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================
   HIGH CONTRAST MODE
   ===================================================== */
@media (prefers-contrast: high) {
    .product-card,
    .cart-section,
    .checkout-summary {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .header,
    .footer,
    .hero__buttons,
    .category-nav,
    .toast-container {
        display: none !important;
    }
    
    .hero {
        min-height: 0;
        padding: 20px 0;
    }
    
    .section {
        padding: 20px 0;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* =====================================================
   CART PAGE - Force no internal scroll (FINAL OVERRIDE)
   ===================================================== */
#cartItemsSection,
#cartItems,
.cart-section,
.cart-section__body,
.cart-main {
    overflow: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
}
/* =====================================================
   AUTH PAGES - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .auth-hero {
        min-height: 150px;
        padding-top: 80px;
    }
    
    .auth-hero__content {
        padding: 24px 16px;
    }
    
    .auth-hero__badge {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 14px;
    }
    
    .auth-hero__title {
        font-size: 1.5rem;
    }
    
    .auth-hero__subtitle {
        font-size: 0.95rem;
    }
    
    .auth-section {
        padding: 30px 0 50px;
    }
    
    .auth-box {
        padding: 24px 20px;
        border-radius: 16px;
        margin: 0 auto;
        max-width: 100%;
    }
    
    .auth-box__header {
        margin-bottom: 24px;
    }
    
    .auth-box__logo {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }
    
    .auth-box__title {
        font-size: 1.4rem;
    }
    
    .auth-box__subtitle {
        font-size: 0.9rem;
    }
    
    .auth-form .form-group {
        margin-bottom: 16px;
    }
    
    .auth-form .btn {
        width: 100%;
        padding: 14px;
    }
    
    .auth-divider {
        margin: 20px 0;
    }
    
    .social-login {
        flex-direction: column;
        gap: 10px;
    }
    
    .social-login .btn {
        width: 100%;
    }
    
    .auth-footer {
        margin-top: 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .auth-box {
        padding: 20px 16px;
    }
    
    .auth-box__title {
        font-size: 1.25rem;
    }
}

/* =====================================================
   ORDERS PAGES - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .orders-hero {
        min-height: 150px;
        padding-top: 70px;
    }
    
    .orders-hero__content {
        padding: 24px 16px;
    }
    
    .orders-hero__badge {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 14px;
    }
    
    .orders-hero__title {
        font-size: 1.5rem;
    }
    
    .orders-hero__subtitle {
        font-size: 0.95rem;
    }
    
    .orders-page {
        padding: 30px 0;
    }
    
    .page-header {
        margin-bottom: 24px;
    }
    
    .page-header h1 {
        font-size: 1.3rem;
        gap: 10px;
    }
    
    .orders-list {
        gap: 14px;
    }
    
    .order-card {
        border-radius: 14px;
    }
    
    .order-card:hover {
        transform: none;
    }
    
    .order-card__header {
        padding: 16px;
        gap: 10px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-card__info h3 {
        font-size: 1rem;
    }
    
    .order-card__meta {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.8rem;
    }
    
    .order-card__body {
        padding: 16px;
    }
    
    .order-card__items {
        gap: 8px;
        margin-bottom: 14px;
    }
    
    .order-card__item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .order-card__footer {
        padding: 14px 16px;
        flex-direction: column;
        gap: 12px;
    }
    
    .order-card__total {
        font-size: 1.1rem;
    }
    
    .order-card__actions {
        width: 100%;
        display: flex;
        gap: 10px;
    }
    
    .order-card__actions .btn {
        flex: 1;
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    /* Order Status Badge */
    .order-status {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    /* Order Detail Page */
    .order-detail {
        padding: 20px;
    }
    
    .order-detail__header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .order-detail__items {
        gap: 12px;
    }
    
    .order-detail__item {
        padding: 14px;
        gap: 12px;
    }
    
    .order-detail__item-image {
        width: 60px;
        height: 60px;
    }
    
    .order-detail__item-name {
        font-size: 0.95rem;
    }
    
    .order-detail__summary {
        padding: 16px;
    }
    
    /* Track Order */
    .order-track {
        padding: 16px;
    }
    
    .order-track__step {
        padding-left: 40px;
        padding-bottom: 24px;
    }
    
    .order-track__step::before {
        left: 12px;
        width: 24px;
        height: 24px;
    }
    
    .order-track__step-title {
        font-size: 0.95rem;
    }
    
    .order-track__step-time {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .orders-hero__title {
        font-size: 1.3rem;
    }
    
    .order-card__header {
        padding: 14px;
    }
    
    .order-card__body {
        padding: 14px;
    }
}

/* =====================================================
   PROFILE PAGE - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .profile-section {
        padding: 30px 0;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .profile-info h2 {
        font-size: 1.3rem;
    }
    
    .profile-info p {
        font-size: 0.9rem;
    }
    
    .profile-stats {
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .profile-stat {
        min-width: 80px;
        text-align: center;
    }
    
    .profile-tabs {
        overflow-x: auto;
        
        
        -ms-overflow-style: none;
    }
    
    .profile-tabs::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
    
    .profile-tab {
        padding: 12px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .profile-card {
        padding: 20px;
        border-radius: 14px;
    }
    
    .profile-card__title {
        font-size: 1.1rem;
    }
    
    /* Addresses */
    .address-list {
        gap: 12px;
    }
    
    .address-item {
        padding: 14px;
    }
    
    .address-item__actions {
        flex-direction: row;
        gap: 8px;
    }
    
    .address-item__actions .btn {
        flex: 1;
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* =====================================================
   SINGLE PRODUCT PAGE - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .product-page {
        padding: 30px 0;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .product-gallery {
        max-width: 100%;
    }
    
    .product-gallery__main {
        aspect-ratio: 4 / 3;
        border-radius: 16px;
    }
    
    .product-gallery__thumbs {
        gap: 8px;
    }
    
    .product-gallery__thumb {
        width: 60px;
        height: 60px;
    }
    
    .product-info {
        padding: 0;
    }
    
    .product-info__category {
        font-size: 0.8rem;
    }
    
    .product-info__name {
        font-size: 1.5rem;
    }
    
    .product-info__price {
        font-size: 1.8rem;
    }
    
    .product-info__desc {
        font-size: 0.95rem;
    }
    
    /* Addon Selection */
    .product-addons {
        margin-top: 20px;
    }
    
    .addon-group {
        margin-bottom: 20px;
    }
    
    .addon-group__title {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .addon-options {
        gap: 8px;
    }
    
    .addon-option {
        padding: 10px 14px;
    }
    
    .addon-option__name {
        font-size: 0.85rem;
    }
    
    .addon-option__price {
        font-size: 0.8rem;
    }
    
    /* Add to Cart Section */
    .product-actions {
        position: sticky;
        bottom: 0;
        background: var(--bg-dark);
        padding: 16px;
        margin: 0 -16px -30px;
        border-top: 1px solid var(--border-color);
        z-index: 10;
    }
    
    .product-actions__quantity {
        margin-bottom: 12px;
    }
    
    .product-actions__btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .product-info__name {
        font-size: 1.3rem;
    }
    
    .product-info__price {
        font-size: 1.5rem;
    }
}

/* =====================================================
   LOCATIONS PAGE - Mobile
   ===================================================== */
@media (max-width: 768px) {
    .locations-hero {
        min-height: 250px;
        padding-top: 70px;
    }
    
    .locations-hero__content {
        padding: 24px 16px;
    }
    
    .locations-hero__badge {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 16px;
    }
    
    .locations-hero__title {
        font-size: 1.75rem;
        margin-bottom: 10px;
    }
    
    .locations-hero__subtitle {
        font-size: 1rem;
    }
    
    .locations-section {
        padding: 50px 0;
    }
    
    .locations-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .location-card {
        border-radius: 18px;
    }
    
    .location-card:hover {
        transform: none;
    }
    
    .location-card__map {
        height: 200px;
    }
    
    .location-card__status {
        top: 12px;
        right: 12px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .location-card__content {
        padding: 20px;
    }
    
    .location-card__header {
        margin-bottom: 16px;
    }
    
    .location-card__icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .location-card__name {
        font-size: 1.25rem;
    }
    
    .location-card__badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .location-card__info {
        gap: 12px;
    }
    
    .location-card__info-item {
        font-size: 0.9rem;
    }
    
    .location-card__info-item i {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .location-card__hours {
        padding: 14px;
    }
    
    .location-card__hours-title {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .location-card__hours-row {
        font-size: 0.85rem;
    }
    
    .location-card__actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .location-card__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .locations-hero {
        min-height: 200px;
    }
    
    .locations-hero__title {
        font-size: 1.5rem;
    }
    
    .location-card__content {
        padding: 16px;
    }
    
    .location-card__icon {
        width: 44px;
        height: 44px;
    }
    
    .location-card__name {
        font-size: 1.15rem;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .header,
    .footer,
    .hero__buttons,
    .category-nav,
    .toast-container {
        display: none !important;
    }
    
    .hero {
        min-height: 0;
        padding: 20px 0;
    }
    
    .section {
        padding: 20px 0;
    }
    
    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
