/* ============================================
   MOBILE IMPROVEMENT STYLES - PESAN PINTU
   ============================================ */

:root {
    --primary-color: #2a9d8f;
    --secondary-color: #DBAE58;
    --dark-color: #222529;
    --light-color: #FFFFFF;
    --gray-light: #f8f9fa;
    --gray-medium: #e7e7e7;
    --border-radius: 12px;
}

/* ============================================
   MOBILE HEADER STYLES (< 768px)
   ============================================ */

@media (max-width: 768px) {
    /* Header Container */
    .header {
        border-bottom: 2px solid var(--gray-medium);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .header-middle {
        padding: 8px 0 !important;
        background-color: var(--light-color);
    }

    .header-middle.sticky-header {
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    /* Header Container Layout */
    .header-middle .container {
        padding: 4px 12px !important;
        min-height: 50px;
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 !important;
    }

    /* Mobile Menu Toggle Button */
    .mobile-menu-toggler {
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: var(--primary-color);
        transition: all 0.3s ease;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .mobile-menu-toggler:hover {
        background-color: var(--gray-light);
        color: var(--secondary-color);
        transform: scale(1.05);
    }

    /* Logo Section */
    .header-center {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 0;
        margin: 0;
    }

    .logo {
        display: flex !important;
        align-items: center;
        gap: 6px;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .logo img {
        width: 48px !important;
        height: 20px !important;
        object-fit: contain;
        display: block;
        box-shadow: none !important;
        filter: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    .logo h4 {
        margin: 0;
        padding: 0;
        font-size: 13px;
        font-weight: 600;
        color: var(--dark-color);
        white-space: nowrap;
        display: block;
    }

    /* Hide unwanted elements */
    .header-left {
        display: none !important;
    }

    .header-right {
        display: none !important;
    }

    .pre-header {
        display: none !important;
    }

    .header-search-wrapper {
        display: none !important;
    }
}

/* ============================================
   STICKY NAVBAR - MOBILE BOTTOM NAVIGATION
   ============================================ */

@media (max-width: 576px) {
    .sticky-navbar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        top: auto !important;
        display: flex !important;
        background-color: var(--light-color);
        border-top: 2px solid var(--gray-medium);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
        z-index: 995 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        height: 60px !important;
        padding: 0;
        margin: 0;
        transition: all 0.3s ease;
    }

    .sticky-navbar.fixed {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    /* Sticky Info Items */
    .sticky-info {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        border: none;
        border-right: 1px solid var(--gray-medium);
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        height: 60px;
    }

    .sticky-info:last-child {
        border-right: none;
    }

    /* Sticky Info Links */
    .sticky-info a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--dark-color);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        gap: 4px;
        width: 100%;
        height: 100%;
        transition: all 0.3s ease;
    }

    .sticky-info a:hover {
        color: var(--primary-color);
        background-color: rgba(42, 157, 143, 0.05);
    }

    .sticky-info a.active {
        color: var(--primary-color);
        background-color: rgba(42, 157, 143, 0.1);
    }

    .sticky-info a.active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--primary-color);
    }

    /* Sticky Info Icons */
    .sticky-info i {
        font-size: 24px;
        color: inherit;
        transition: all 0.3s ease;
    }

    .sticky-info:hover i {
        transform: scale(1.1);
    }

    /* Text for sticky info */
    .sticky-info span {
        display: block;
    }
}

/* ============================================
   MOBILE MENU STYLES
   ============================================ */

@media (max-width: 768px) {
    .mobile-menu-container {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, var(--light-color) 0%, #f8f9fa 100%);
        z-index: 999;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
        padding-top: 0;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .mobile-menu-container.active {
        left: 0;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .mobile-menu-overlay.active {
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Menu Header */
    .mobile-menu-wrapper {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    /* Close Button */
    .mobile-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 12px 12px 0 auto;
        cursor: pointer;
        font-size: 28px;
        color: var(--dark-color);
        transition: all 0.3s ease;
        border-radius: 8px;
        background: transparent;
        border: none;
        padding: 0;
    }

    .mobile-menu-close:hover {
        background-color: rgba(42, 157, 143, 0.1);
        color: var(--primary-color);
        transform: rotate(90deg);
    }

    /* Mobile Menu Navigation */
    .mobile-nav {
        flex: 1;
        overflow-y: auto;
    }

    .mobile-menu {
        list-style: none;
        padding: 12px 0;
        margin: 0;
    }

    .mobile-menu li {
        padding: 0;
        margin: 0;
        border-bottom: none;
    }

    .mobile-menu a {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 14px 16px !important;
        color: var(--dark-color) !important;
        text-decoration: none !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        position: relative !important;
        border-left: 3px solid transparent !important;
        margin: 2px 8px !important;
        border-radius: 8px !important;
    }

    .mobile-menu a::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 3px !important;
        background: var(--primary-color) !important;
        border-radius: 0 3px 3px 0 !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }

    .mobile-menu a:hover {
        background-color: rgba(42, 157, 143, 0.08) !important;
        color: var(--primary-color) !important;
        padding-left: 24px !important;
        border-left-color: var(--primary-color) !important;
    }

    .mobile-menu a:hover::before {
        opacity: 1 !important;
    }

    .mobile-menu li:first-child a::before {
        opacity: 1 !important;
    }

    .mobile-menu li:first-child a {
        border-left-color: var(--primary-color) !important;
        color: var(--primary-color) !important;
        background-color: rgba(42, 157, 143, 0.08) !important;
    }

    /* Menu Icons */
    .mobile-menu a i {
        font-size: 20px !important;
        width: 24px !important;
        height: 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: transform 0.3s ease !important;
        flex-shrink: 0 !important;
    }

    .mobile-menu a:hover i {
        transform: scale(1.1) !important;
    }

    /* Search in Mobile Menu */
    .search-wrapper {
        margin: auto 12px 16px 12px !important;
        display: flex;
        gap: 0;
        border: 2px solid var(--primary-color);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(42, 157, 143, 0.15);
        background: var(--light-color);
    }

    .search-wrapper input {
        flex: 1;
        border: none;
        padding: 11px 14px;
        font-size: 14px;
        outline: none;
        background: var(--light-color) !important;
        color: var(--dark-color);
    }

    .search-wrapper input::placeholder {
        color: #999;
    }

    .search-wrapper .btn {
        background: var(--primary-color) !important;
        color: var(--light-color) !important;
        padding: 0 12px !important;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        font-size: 16px;
        width: 44px;
        height: 100%;
        margin: 0 !important;
    }

    .search-wrapper .btn:hover {
        background: #1f8578 !important;
        transform: scale(1.05);
    }

    .search-wrapper .btn i {
        font-size: 16px;
    }
}

/* ============================================
   BANNER STYLES - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .home-slider-container {
        padding: 0;
        margin: 0;
    }

    .home-slider {
        margin: 0;
        padding: 0;
    }

    .home-slide figure {
        margin: 0;
        padding: 0;
        border-radius: 0;
    }

    .home-slide figure img {
        width: 100%;
        height: auto;
        max-height: 300px;
        object-fit: cover;
        display: block;
    }
}

/* ============================================
   CATEGORY CAROUSEL - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .category-carousel-section {
        padding: 16px 0;
    }

    .category-carousel-wrapper {
        padding: 0;
    }

    .category-carousel-title {
        font-size: 16px;
        font-weight: 600;
        margin: 0 16px 12px 16px;
        color: var(--dark-color);
    }

    .swiper.category-swiper {
        padding: 0 4px;
    }

    .swiper-slide {
        height: auto;
    }

    .category-card-modern {
        height: 100%;
    }

    .category-card-link {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .category-card-image {
        flex: 1;
        min-height: 180px;
        border-radius: 8px;
        overflow: hidden;
    }

    .category-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .category-card-info {
        padding: 6px 6px 0 6px;
        min-height: 32px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .category-card-name {
        font-size: 12px;
        font-weight: 600;
        margin: 0;
        flex: 1;
        color: var(--dark-color);
    }

    .category-card-arrow {
        color: var(--primary-color);
        font-size: 14px;
        flex-shrink: 0;
    }
}

/* ============================================
   BODY PADDING - ACCOUNT FOR STICKY NAVBAR
   ============================================ */

@media (max-width: 576px) {
    body {
        padding-bottom: 60px;
    }

    .main {
        padding-bottom: 10px;
    }
}

/* ============================================
   PRODUCTS GRID - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .all-products-section {
        padding: 16px 0;
    }

    .all-products-section .section-title {
        font-size: 18px;
        margin: 0 16px 8px 16px;
        font-weight: 600;
        color: var(--dark-color);
    }

    .heading-spacer {
        margin: 0 16px 16px 16px;
        height: 2px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
        border-radius: 1px;
    }

    .products-grid {
        padding: 0 8px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    @media (max-width: 480px) {
        .products-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            padding: 0 4px;
        }
    }
}

/* ============================================
   CONTAINER PADDING - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ============================================
   SMOOTH TRANSITIONS
   ============================================ */

* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Prevent transition on load */
body.loaded * {
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}
