

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #111;
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: 75px;
    -webkit-font-smoothing: antialiased;
    background: white !important;
    
}

/* ============================================ */
/* MAIN CONTAINER                               */
/* ============================================ */

.main-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 8px 12px;
    
    overflow-x: hidden;
}

/* ============================================ */
/* SEARCH SECTION - Native App Style           */
/* ============================================ */

.search-section {
    margin-bottom: 16px;
    padding: 0;
}

.search-box {
    display:none !important;
    max-width: 100%;
    margin: 0;
    gap: 0;
    background: white;
    border-radius:15px;
    height: 35px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-box:focus-within {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-input {
    flex: 1;
    padding: 0 16px;
    border: none;
    font-size: 15px;
    font-weight: 400;
    background: transparent;
    color: #111;
    outline: none;
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
    font-size: 15px;
}

.search-btn {
    background: #f97316;
    color: white;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    gap: 6px;
    font-weight: 600;
    min-width: 60px;
    transition: opacity 0.2s;
}

.search-btn:active {
    opacity: 0.8;
}

.search-btn i {
    font-size: 14px;
}

.search-btn span {
    display: inline;
}

/* ============================================ */
/* CATEGORIES GRID - 2 Columns on Mobile       */
/* ============================================ */

.categories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 0;
}

.category-card {
    display: block;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: transform 0.15s ease;
    cursor: pointer;
}

.category-card:active {
    transform: scale(0.97);
    border-color: #f97316;
}

.category-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f5f5f5;
}

.category-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-img i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: #ccc;
}

.category-info {
    padding: 10px 12px 14px;
    text-align: left;
}

.category-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-meta {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-meta i {
    font-size: 11px;
}

/* ============================================ */
/* SUBCATEGORIES SECTION                       */
/* ============================================ */

.subcategories-section {
    margin-top: 16px;
    margin-bottom: 0;
    padding: 0;
    background: transparent !important;
    border-radius: 0;
}

.subcategories-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
}

.subcategories-title i {
    font-size: 14px;
    color: #f97316;
}

/* ============================================ */
/* SUBCATEGORIES GRID - 4 Columns on Mobile    */
/* ============================================ */

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.subcategory-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #111;
    transition: transform 0.15s ease;
    text-align: center;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.subcategory-card:active {
    transform: scale(0.95);
    border-color: #f97316;
}

.subcategory-img {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.subcategory-img img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}

.subcategory-img i {
    font-size: 28px;
    color: #ccc;
}

.subcategory-info {
    width: 100%;
    text-align: center;
}

.subcategory-name {
    font-weight: 600;
    font-size: 11px;
    color: #111;
    line-height: 1.3;
    display: -webkit-box;
    
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 28px;
}

.subcategory-count {
    font-size: 9px;
    color: #999;
    font-weight: 500;
}

/* ============================================ */
/* DIVIDER                                      */
/* ============================================ */

.category-divider {
    display: none !important;
}

/* ============================================ */
/* EMPTY STATE                                  */
/* ============================================ */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e5e5;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 14px;
}

.empty-state h3 {
    color: #111;
    font-size: 18px;
    margin-bottom: 6px;
}

.empty-state p {
    color: #737373;
    font-size: 14px;
    margin-bottom: 16px;
}

.btn-primary {
    display: inline-block;
    background: #f97316;
    color: white;
    padding: 10px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary:active {
    opacity: 0.8;
    transform: scale(0.97);
}

/* ============================================ */
/* RESPONSIVE - TABLET (750px+)                 */
/* ============================================ */

@media (min-width: 750px) {
    .main-container {
        padding: 12px 20px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .search-box {
        max-width: 500px;
        margin: 0 auto;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .subcategories-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 14px;
    }

    .subcategory-img img {
        width: 70px;
        height: 70px;
    }

    .subcategory-name {
        font-size: 12px;
    }
}

/* ============================================ */
/* RESPONSIVE - LARGE DESKTOP (1025px+)         */
/* ============================================ */

@media (min-width: 1025px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .subcategories-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 16px;
    }

    .subcategory-img img {
        width: 80px;
        height: 80px;
    }

    .subcategory-name {
        font-size: 13px;
    }

    .category-info h3 {
        font-size: 15px;
    }
}

/* ============================================ */
/* RESPONSIVE - SMALL MOBILE (below 480px)     */
/* ============================================ */

@media (max-width: 480px) {
    .main-container {
        padding: 6px 10px;
    }

    .search-box {
        height: 44px;
    }

    .search-input {
        font-size: 14px;
        padding: 0 14px;
    }

    .search-btn {
        padding: 0 14px;
        font-size: 13px;
        min-width: 50px;
    }

    .search-btn span {
        display: none;
    }

    .search-btn i {
        font-size: 16px;
    }

    .categories-grid {
        gap: 10px;
    }

    .category-info {
        padding: 8px 10px 12px;
    }

    .category-info h3 {
        font-size: 13px;
    }

    .subcategories-grid {
        gap: 10px;
    }

    .subcategory-img img {
        width: 50px;
        height: 50px;
    }

    .subcategory-name {
        font-size: 10px;
        min-height: 24px;
    }

    .subcategory-count {
        font-size: 8px;
    }

    .subcategories-title {
        font-size: 14px;
    }
}

/* ============================================ */
/* RESPONSIVE - VERY SMALL (below 380px)       */
/* ============================================ */

@media (max-width: 380px) {
    .subcategories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .subcategory-img img {
        width: 44px;
        height: 44px;
    }

    .subcategory-name {
        font-size: 9px;
        min-height: 20px;
    }

    .categories-grid {
        gap: 8px;
    }

    .category-info h3 {
        font-size: 12px;
    }

    .category-meta {
        font-size: 10px;
    }
}

/* ============================================ */
/* TOUCH DEVICE OPTIMIZATIONS                   */
/* ============================================ */

@media (hover: none) and (pointer: coarse) {
    .category-card:hover,
    .subcategory-card:hover {
        transform: none !important;
    }

    .category-card:active {
        transform: scale(0.97) !important;
        border-color: #f97316 !important;
    }

    .subcategory-card:active {
        transform: scale(0.95) !important;
        border-color: #f97316 !important;
    }
}

/* ============================================ */
/* UTILITY                                      */
/* ============================================ */

.text-center {
    text-align: center;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hide scrollbars globally */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

::selection {
    background: #f97316;
    color: white;
}

/* ============================================ */
/* SAFE AREA (Notch phones)                    */
/* ============================================ */

@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }
}