/*====================================================================
  WINKELKART - COMPREHENSIVE MOBILE RESPONSIVE CSS
  Supports: All mobile brands from 280px to 991px
  Created: March 2026
====================================================================*/

/* ================= CSS VARIABLES ================= */
:root {
    --wk-green: #43a047;
    --wk-dark-green: #2e7d32;
    --wk-light-green: #e8f5e9;
    --wk-yellow: #fdd835;
    --wk-pink: #e91e63;
    --wk-blue: #1e88e5;
    --text-main: #212121;
    --text-light: #757575;
    --bg-body: #f5f5f5;
    --white: #ffffff;
    
    /* Mobile-specific spacing */
    --mobile-padding-xs: 8px;
    --mobile-padding-sm: 12px;
    --mobile-padding-md: 16px;
    --mobile-padding-lg: 20px;
}

/* ================= GLOBAL MOBILE FIXES ================= */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent font scaling in landscape while allowing user zoom */
@media screen and (max-width: 991px) {
    html {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* ================= TOUCH-FRIENDLY ELEMENTS ================= */
@media (max-width: 991px) {
    /* Minimum touch target size (44x44px recommended by Apple/Google) */
    a, button, .btn,
    input[type="submit"],
    input[type="button"],
    .clickable,
    .action-btn,
    .action-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent iOS zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ================= HEADER MOBILE STYLES ================= */

/* Tablet & Large Mobile (768px - 991px) */
@media (max-width: 991px) {
    header {
        position: sticky !important;
        top: 0;
        z-index: 1000;
        overflow-x: hidden;
    }
    
    .header-main {
        padding: 10px 0;
    }
    
    .header-wrapper {
        padding: 0 var(--mobile-padding-sm);
        gap: 10px;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    /* Hide desktop search */
    .header-search-container,
    .desktop-search-only {
        display: none !important;
    }
    
    /* Hide sub-navbar on mobile */
    .sub-navbar,
    .desktop-navigation-menu {
        display: none !important;
    }
    
    /* Show mobile menu toggle */
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        color: white;
        cursor: pointer;
        background: none;
        border: none;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Logo adjustments */
    .header-logo img {
        height: 45px;
        width: auto;
    }
    
    .logo-tagline {
        display: none;
    }
    
    .logo-main-text span {
        font-size: 22px !important;
    }
    
    /* Header actions */
    .header-actions {
        gap: 10px;
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .action-item span {
        display: none;
    }
    
    .action-item ion-icon {
        font-size: 24px;
    }
    
    /* Sell button on tablet */
    .sell-btn {
        display: inline-flex !important;
        padding: 6px 12px;
        font-size: 12px !important;
        white-space: nowrap;
        height: auto;
        min-height: 34px;
    }
}

/* Standard Mobile (576px - 767px) */
@media (max-width: 767px) {
    .header-wrapper {
        padding: 0 var(--mobile-padding-sm);
        gap: 8px;
    }
    
    .header-logo img {
        height: 40px;
    }
    
    .logo-main-text span {
        font-size: 20px !important;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .action-item ion-icon {
        font-size: 22px;
    }
    
    .menu-toggle {
        font-size: 26px;
        padding: 6px;
    }
}

/* Small Mobile (480px - 575px) - iPhone SE, older phones */
@media (max-width: 575px) {
    .header-main {
        padding: 8px 0;
    }
    
    .header-wrapper {
        padding: 0 10px;
        gap: 6px;
    }
    
    .header-logo img {
        height: 36px;
    }
    
    .logo-main-text span {
        font-size: 18px !important;
    }
    
    .logo-text-container {
        margin-left: 4px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .sell-btn {
        padding: 5px 10px;
        font-size: 11px !important;
    }
    
    .action-item ion-icon {
        font-size: 20px;
    }
    
    .menu-toggle {
        font-size: 24px;
    }
}

/* Extra Small Mobile (400px - 479px) */
@media (max-width: 479px) {
    .sell-btn .sell-text {
        display: none;
    }
    
    .sell-btn .sell-icon {
        display: inline !important;
        font-size: 16px;
    }
    
    .sell-btn {
        padding: 6px 8px !important;
        width: 36px;
        height: 36px;
        justify-content: center;
        min-width: 36px;
        min-height: 36px;
    }
}

/* Very Small Mobile (360px - 399px) - Galaxy S series, basic Android */
@media (max-width: 399px) {
    .header-main {
        padding: 6px 0;
    }
    
    .header-wrapper {
        padding: 0 8px;
        gap: 4px;
    }
    
    .header-logo img {
        height: 32px;
    }
    
    .logo-main-text span {
        font-size: 16px !important;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .action-item ion-icon {
        font-size: 18px;
    }
    
    .sell-btn {
        width: 32px;
        height: 32px;
        padding: 5px !important;
    }
    
    .menu-toggle {
        font-size: 22px;
        min-width: 36px;
        min-height: 36px;
        padding: 4px;
    }
}

/* Ultra Small Mobile (280px - 359px) - Galaxy Fold, older small phones */
@media (max-width: 359px) {
    .header-main {
        padding: 5px 0;
    }
    
    .header-wrapper {
        padding: 0 6px;
        gap: 3px;
    }
    
    .header-logo img {
        height: 28px;
    }
    
    .logo-main-text span {
        font-size: 14px !important;
    }
    
    .logo-text-container {
        margin-left: 3px;
    }
    
    .action-item ion-icon {
        font-size: 16px;
    }
    
    .sell-btn {
        width: 28px;
        height: 28px;
        padding: 4px !important;
        min-width: 28px;
        min-height: 28px;
    }
    
    .menu-toggle {
        font-size: 20px;
        min-width: 32px;
        min-height: 32px;
    }
}

/* ================= MOBILE SEARCH (Inside Mobile Menu) ================= */
/* The primary search interface on mobile devices */
.mobile-search {
    display: block;
    padding: 16px;
    background: linear-gradient(135deg, var(--wk-green) 0%, var(--wk-dark-green) 100%);
}

.mobile-search form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-search input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    color: var(--text-main);
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    min-height: 50px;
}

.mobile-search input:focus {
    border-color: var(--wk-yellow);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mobile-search input::placeholder {
    color: #888;
    font-size: 14px;
}

.mobile-search button {
    background: var(--wk-pink);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-search button:hover,
.mobile-search button:active {
    background: #c2185b;
    transform: scale(1.05);
}

@media (max-width: 479px) {
    .mobile-search {
        padding: 14px 12px;
    }
    
    .mobile-search input {
        padding: 12px 14px;
        font-size: 14px;
        min-height: 46px;
        border-radius: 10px;
    }
    
    .mobile-search input::placeholder {
        font-size: 13px;
    }
    
    .mobile-search button {
        width: 46px;
        height: 46px;
        border-radius: 10px;
        font-size: 16px;
    }
}

@media (max-width: 359px) {
    .mobile-search {
        padding: 12px 10px;
        gap: 8px;
    }
    
    .mobile-search input {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 42px;
        border-radius: 8px;
    }
    
    .mobile-search input::placeholder {
        font-size: 12px;
    }
    
    .mobile-search button {
        width: 42px;
        height: 42px;
        border-radius: 8px;
        font-size: 14px;
    }
}

@media (max-width: 280px) {
    .mobile-search {
        padding: 10px 8px;
    }
    
    .mobile-search input {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 38px;
    }
    
    .mobile-search button {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
}

/* ================= MOBILE MENU ================= */
.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--white);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 0;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.show {
    display: flex;
}

/* Mobile menu items */
.mobile-menu .menu-category {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    list-style: none;
}

.mobile-menu .menu-category a,
.mobile-menu .menu-category button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #444;
    text-decoration: none;
    min-height: 52px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-menu .menu-category a:hover,
.mobile-menu .menu-category button:hover {
    background: #f5f5f5;
}

.mobile-menu .menu-category a:active,
.mobile-menu .menu-category button:active {
    background: #e8e8e8;
}

/* User greeting in mobile menu */
.mobile-user-greeting {
    background: var(--wk-light-green) !important;
    padding: 14px 20px !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #c8e6c9 !important;
}

.mobile-user-greeting ion-icon {
    font-size: 28px;
    color: var(--wk-dark-green);
}

.mobile-user-greeting span {
    font-size: 15px;
    font-weight: 600;
    color: var(--wk-dark-green);
}

/* Mobile menu logout button */
.mobile-menu form button[type="submit"] {
    color: #d32f2f !important;
}

@media (max-width: 479px) {
    .mobile-search {
        padding: 12px 14px;
    }
    
    .mobile-search input {
        padding: 12px 14px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .mobile-search button {
        padding: 12px 14px;
        min-height: 44px;
        min-width: 44px;
    }
    
    .mobile-menu .menu-category a,
    .mobile-menu .menu-category button {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 48px;
    }
    
    .mobile-user-greeting {
        padding: 12px 16px !important;
    }
    
    .mobile-user-greeting ion-icon {
        font-size: 24px;
    }
    
    .mobile-user-greeting span {
        font-size: 14px;
    }
}

@media (max-width: 359px) {
    .mobile-search {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .mobile-search input {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .mobile-search button {
        padding: 10px 12px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .mobile-menu .menu-category a,
    .mobile-menu .menu-category button {
        padding: 12px 14px;
        font-size: 13px;
        min-height: 44px;
    }
}

/* ================= TOP BRANDING BAR ================= */
@media (max-width: 767px) {
    .top-branding {
        padding: 6px 0;
        font-size: 12px;
    }
    
    .top-branding marquee p {
        font-size: 12px;
    }
}

@media (max-width: 479px) {
    .top-branding {
        padding: 5px 0;
        font-size: 11px;
    }
    
    .top-branding marquee p {
        font-size: 11px;
    }
}

@media (max-width: 359px) {
    .top-branding {
        padding: 4px 0;
        font-size: 10px;
    }
    
    .top-branding marquee p {
        font-size: 10px;
    }
}

/* ================= USER DROPDOWN MOBILE ================= */
@media (max-width: 991px) {
    .custom-dropdown-menu {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        transform: none !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
        max-height: 70vh;
        overflow-y: auto;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .custom-dropdown-item {
        padding: 16px 24px;
        font-size: 16px;
        min-height: 52px;
    }
    
    .logout-btn {
        padding: 16px 24px;
        font-size: 16px;
        min-height: 52px;
    }
}

@media (max-width: 479px) {
    .custom-dropdown-menu {
        border-radius: 16px 16px 0 0 !important;
    }
    
    .custom-dropdown-item {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .logout-btn {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
}

/* ================= CONTAINER & SECTIONS ================= */
@media (max-width: 991px) {
    .container {
        padding: 0 var(--mobile-padding-md) !important;
        max-width: 100% !important;
    }
    
    main {
        overflow-x: hidden;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 0 var(--mobile-padding-sm) !important;
    }
    
    section, .section {
        padding-left: var(--mobile-padding-sm);
        padding-right: var(--mobile-padding-sm);
    }
}

@media (max-width: 479px) {
    .container {
        padding: 0 var(--mobile-padding-sm) !important;
    }
}

@media (max-width: 359px) {
    .container {
        padding: 0 var(--mobile-padding-xs) !important;
    }
}

/* ================= TYPOGRAPHY MOBILE ================= */
@media (max-width: 767px) {
    h1 { font-size: 28px !important; }
    h2 { font-size: 22px !important; }
    h3 { font-size: 18px !important; }
    h4 { font-size: 16px !important; }
    h5 { font-size: 14px !important; }
    h6 { font-size: 12px !important; }
    p, body { font-size: 14px; }
}

@media (max-width: 479px) {
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 16px !important; }
    h4 { font-size: 15px !important; }
}

@media (max-width: 359px) {
    h1 { font-size: 20px !important; }
    h2 { font-size: 18px !important; }
    h3 { font-size: 15px !important; }
}

/* ================= FOOTER MOBILE ================= */
@media (max-width: 991px) {
    .footer-wrapper {
        grid-template-columns: 1fr 1fr;
        text-align: left;
        gap: 30px;
        padding: 0 var(--mobile-padding-md) 40px;
    }
    
    .footer-col h3::after {
        left: 0;
        transform: none;
    }
    
    .footer-col .social-icons {
        justify-content: flex-start;
    }
    
    .footer-col ul li a {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .footer-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
        padding: 0 var(--mobile-padding-sm) 30px;
    }
    
    .footer-col h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-col .social-icons {
        justify-content: center;
    }
    
    .footer-col ul li a {
        justify-content: center;
    }
}

@media (max-width: 479px) {
    .footer {
        padding-top: 30px;
    }
    
    .footer-wrapper {
        gap: 20px;
        padding: 0 var(--mobile-padding-sm) 24px;
    }
    
    .footer-col h3 {
        font-size: 15px;
        margin-bottom: 14px;
    }
    
    .footer-col > p,
    .footer-col ul li a {
        font-size: 12px;
    }
    
    .footer-col .social-icons a ion-icon {
        font-size: 20px;
    }
}

@media (max-width: 359px) {
    .footer-wrapper {
        padding: 0 var(--mobile-padding-xs) 20px;
    }
    
    .footer-col h3 {
        font-size: 14px;
    }
    
    .footer-col > p,
    .footer-col ul li a {
        font-size: 11px;
    }
}

/* Footer bottom */
@media (max-width: 767px) {
    .footer-bottom {
        padding: 16px var(--mobile-padding-sm);
    }
    
    .footer-bottom .copyright {
        font-size: 11px;
        line-height: 1.6;
    }
    
    .footer-bottom .payment-img {
        max-height: 24px;
    }
}

@media (max-width: 479px) {
    .footer-bottom {
        padding: 14px var(--mobile-padding-sm);
    }
    
    .footer-bottom .copyright {
        font-size: 10px;
    }
    
    .footer-bottom .payment-img {
        max-height: 20px;
    }
}

/* Safe area for notched phones (iPhone X+) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .footer, footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .mobile-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ================= GRID UTILITIES MOBILE ================= */
@media (max-width: 991px) {
    .mobile-col-1 { grid-template-columns: 1fr !important; }
    .mobile-col-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .mobile-stack { flex-direction: column !important; }
    .mobile-hide { display: none !important; }
    .mobile-show { display: block !important; }
    .mobile-full-width { width: 100% !important; max-width: 100% !important; }
}

@media (max-width: 479px) {
    .xs-col-1 { grid-template-columns: 1fr !important; }
    .xs-hide { display: none !important; }
    .xs-show { display: block !important; }
}

/* ================= IMAGE RESPONSIVE ================= */
@media (max-width: 991px) {
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ================= TABLE RESPONSIVE ================= */
@media (max-width: 767px) {
    .table-responsive, .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    table {
        min-width: 600px;
    }
}

/* ================= FORM MOBILE ================= */
@media (max-width: 767px) {
    .form-row, .form-group {
        margin-bottom: 14px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 8px;
    }
}

@media (max-width: 479px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        padding: 12px 14px;
    }
}

/* ================= BUTTONS MOBILE ================= */
@media (max-width: 767px) {
    .btn, button, [type="submit"], [type="button"] {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .btn-sm {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px;
    }
}

/* ================= CARDS MOBILE ================= */
@media (max-width: 767px) {
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .card-body {
        padding: 16px;
    }
}

@media (max-width: 479px) {
    .card-body {
        padding: 12px;
    }
}

/* ================= HERO/SLIDER MOBILE ================= */
@media (max-width: 991px) {
    .hero-slider {
        height: 350px;
    }
    
    .slide-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 0 20px;
    }
    
    .slide-text {
        max-width: 100%;
    }
    
    .slide-text h2 {
        font-size: 32px;
    }
    
    .slide-text p {
        font-size: 14px;
    }
    
    .slide-img {
        width: 200px;
        height: 180px;
    }
    
    .slide-img img {
        max-height: 160px;
        max-width: 180px;
    }
    
    .slider-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .slider-arrow.prev { left: 10px; }
    .slider-arrow.next { right: 10px; }
}

@media (max-width: 767px) {
    .hero-slider {
        height: 300px;
    }
    
    .slide-text h2 {
        font-size: 26px;
        margin-bottom: 10px;
    }
    
    .slide-text p {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .slide-btn {
        padding: 10px 24px;
        font-size: 13px;
    }
    
    .slide-img {
        width: 160px;
        height: 140px;
    }
    
    .slide-img img {
        max-height: 120px;
        max-width: 140px;
    }
    
    .slider-dots {
        bottom: 16px;
    }
    
    .dot {
        width: 6px;
        height: 6px;
    }
    
    .dot.active {
        width: 20px;
    }
}

@media (max-width: 479px) {
    .hero-slider {
        height: 260px;
    }
    
    .slide-content {
        padding: 0 12px;
    }
    
    .slide-text h2 {
        font-size: 22px;
    }
    
    .slide-text p {
        font-size: 12px;
        margin-bottom: 16px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .slide-btn {
        padding: 8px 20px;
        font-size: 12px;
    }
    
    .slide-img {
        display: none;
    }
    
    .slide-tag {
        font-size: 10px;
        padding: 4px 12px;
    }
    
    .slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

@media (max-width: 359px) {
    .hero-slider {
        height: 220px;
    }
    
    .slide-text h2 {
        font-size: 18px;
    }
    
    .slide-text p {
        font-size: 11px;
    }
    
    .slider-arrow {
        display: none;
    }
}

/* ================= PRODUCT CARDS MOBILE ================= */
@media (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-card {
        border-radius: 10px;
    }
    
    .product-card img {
        height: 150px;
    }
    
    .product-card .product-title {
        font-size: 13px;
    }
    
    .product-card .product-price {
        font-size: 14px;
    }
}

@media (max-width: 479px) {
    .product-grid {
        gap: 10px;
    }
    
    .product-card img {
        height: 120px;
    }
    
    .product-card .product-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .product-card .product-price {
        font-size: 13px;
    }
}

/* Samsung Galaxy and similar devices (360px-375px) */
@media (max-width: 375px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
        max-width: 100%;
    }
    
    .product-card {
        padding: 8px;
        min-width: 0;
        overflow: hidden;
    }
    
    .product-card img {
        height: 100px;
    }
    
    .product-card .product-title {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }
    
    .product-card .product-price {
        font-size: 12px;
    }
    
    /* Ensure all containers don't overflow */
    .page-wrapper,
    .main-content,
    .container,
    section {
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 359px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .product-card {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    
    .product-card img {
        width: 100px;
        height: 100px;
        flex-shrink: 0;
    }
}

/* ================= SECTION HEADERS MOBILE ================= */
@media (max-width: 767px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
        padding-bottom: 14px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .section-title ion-icon {
        font-size: 18px;
    }
    
    .view-all {
        font-size: 13px;
    }
}

@media (max-width: 479px) {
    .section-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

/* ================= CATEGORY CARDS MOBILE ================= */
@media (max-width: 767px) {
    .category-item {
        min-width: calc(50% - 8px);
    }
    
    .category-item img {
        width: 50px;
        height: 50px;
    }
    
    .category-item-title {
        font-size: 12px;
    }
}

@media (max-width: 479px) {
    .category-item {
        min-width: calc(33.33% - 6px);
        padding: 12px 8px;
    }
    
    .category-item img {
        width: 40px;
        height: 40px;
    }
    
    .category-item-title {
        font-size: 11px;
    }
}

/* ================= HORIZONTAL SCROLLERS MOBILE ================= */
@media (max-width: 767px) {
    .has-scrollbar {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .has-scrollbar::-webkit-scrollbar {
        display: none;
    }
    
    .has-scrollbar > * {
        scroll-snap-align: start;
    }
}

/* ================= MODALS & OVERLAYS MOBILE ================= */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
}

/* ================= ALERTS & NOTIFICATIONS MOBILE ================= */
@media (max-width: 767px) {
    .alert {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 8px;
    }
}

/* ================= PAGINATION MOBILE ================= */
@media (max-width: 767px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .page-link {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
        min-height: 36px;
    }
}

/* ================= LANDSCAPE MOBILE FIXES ================= */
@media (max-width: 991px) and (orientation: landscape) {
    .hero-slider {
        height: 250px;
    }
    
    .mobile-menu {
        max-height: 70vh;
    }
    
    .custom-dropdown-menu {
        max-height: 60vh;
    }
}

/* ================= SPECIFIC DEVICE FIXES ================= */

/* iPhone SE, 5, 5S (320px) */
@media (max-width: 320px) {
    .header-logo img {
        height: 26px;
    }
    
    .logo-main-text span {
        font-size: 13px !important;
    }
    
    .sell-btn {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
    }
}

/* Galaxy Fold (280px) */
@media (max-width: 280px) {
    .header-logo {
        max-width: 80px;
    }
    
    .header-logo img {
        height: 24px;
    }
    
    .logo-main-text {
        display: none;
    }
    
    .header-actions {
        gap: 2px;
    }
    
    .menu-toggle {
        font-size: 18px;
        min-width: 28px;
        min-height: 28px;
    }
}

/* ================= PRINT STYLES ================= */
@media print {
    header, .mobile-menu, .top-branding, footer, .mobile-search-bar {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
}
