/* =======================================================
   1. GLOBAL RESET & FONT
   ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f5; 
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =======================================================
   2. HEADER & PENCARIAN
   ======================================================= */
.header {
    background-color: #ee4d2d; 
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 40px;
}

.logo {
    color: white;
    font-size: 26px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.search-section {
    flex-grow: 1;
}

.search-bar {
    display: flex;
    background: white;
    border-radius: 3px;
    overflow: hidden;
    padding: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-bar input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    background-color: #ee4d2d;
    color: white;
    border: none;
    padding: 0 24px;
    cursor: pointer;
    border-radius: 2px;
    font-size: 16px;
    transition: background-color 0.2s;
}

.search-bar button:hover {
    background-color: #f05d40;
}

/* =======================================================
   3. WADAH DIREKTORI UTAMA
   ======================================================= */
.directory-section {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.directory-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 25px;
    color: #333;
    text-transform: uppercase;
}

/* =======================================================
   4. FILTER ABJAD (ALPHABET LIST) - EFEK MENGAMBANG
   ======================================================= */
.alphabet-filter {
    position: sticky; 
    top: 73px; /* Mengambang tepat di bawah header PC */
    background-color: white; 
    z-index: 90; 
    padding: 15px 0 20px 0; 
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 30px;
}

.store-count {
    font-size: 14px;
    color: #757575;
    margin-bottom: 15px;
}

.alphabet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.alpha-char {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 2px;
    font-size: 14px;
    color: #555;
    background-color: #f5f5f5;
    transition: all 0.2s ease;
}

.alpha-char:hover:not(.disabled) {
    color: #ee4d2d;
    background-color: #fdf6f5;
}

.alpha-char.active {
    background-color: #ee4d2d;
    color: white;
    font-weight: bold;
}

.alpha-char.disabled {
    color: #ccc;
    background-color: #fafafa;
    pointer-events: none;
    cursor: not-allowed;
}

/* =======================================================
   5. GRID MEREK / TOKO
   ======================================================= */
.brand-group {
    margin-bottom: 40px;
}

.group-letter {
    /* Mencegah huruf tertutup oleh header dan abjad yang mengambang */
    scroll-margin-top: 170px; 
    
    font-size: 22px;
    color: #ee4d2d;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
}

.brand-dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    border: 1px solid #f5f5f5;
    border-radius: 4px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.brand-item:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-color: #ee4d2d;
}

.brand-logo-box {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.brand-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}

.brand-name {
    font-size: 14px;
    color: #333;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =======================================================
   6. RESPONSIF (TABLET & MOBILE)
   ======================================================= */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row; 
        align-items: center;
        gap: 15px;
    }

    /* Hilangkan Logo di Layar Kecil */
    .logo {
        display: none !important; 
    }

    .search-section {
        flex-grow: 1;
        width: 100%;
    }
    
    .brand-dir-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    .header-container {
        gap: 10px;
        padding: 0 10px;
    }

    .search-bar input {
        padding: 8px 10px;
        font-size: 12px;
    }
    .search-bar button {
        padding: 0 15px;
        font-size: 14px;
    }

    /* Penyesuaian Efek Mengambang & Jarak Scroll di HP */
    .alphabet-filter {
        top: 64px; /* Karena header HP lebih tipis */
        padding: 10px 0 15px 0;
        margin-bottom: 20px;
    }

    .group-letter {
        scroll-margin-top: 240px;
    }

    .directory-section {
        margin: 10px;
        padding: 15px;
    }

    /* Grid Merek di HP menjadi lebih padat */
    .brand-dir-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .brand-logo-box {
        width: 60px;
        height: 60px;
    }

    .brand-name {
        font-size: 12px;
    }
    
    .alpha-char {
        min-width: 28px;
        height: 28px;
        font-size: 13px;
        padding: 0 5px;
    }
}