/* General Styling & Reset */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.wrapper {
    flex: 1; /* Wrapper akan mengambil semua ruang yang tersedia, mendorong footer ke bawah */
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Header Styling */
header {
    background-color: #ffffff;
    padding: 30px 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

header .logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 10px;
}

header h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.5em;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    color: #666;
}

/* Main Content Styling */
main {
    flex: 1; /* Main akan mengisi ruang kosong yang tersedia */
    display: flex;
    flex-direction: column;
}

/* Search Section Styling */
.search-section {
    padding: 30px 0;
    background-color: #f9f9f9;
}

.search-box {
    display: flex;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #fff;
}

.search-box input {
    flex-grow: 1;
    border: none;
    padding: 12px 15px;
    font-size: 1em;
    outline: none;
}

.search-box .search-icon {
    padding: 12px 15px;
    background-color: #f0f0f0;
    color: #555;
    cursor: pointer;
    font-size: 1.2em;
}

/* Pricelist Section Styling */
.pricelist-section {
    padding: 20px 0 50px 0;
}

/* Loading Message */
.loading-message {
    text-align: center;
    font-style: italic;
    color: #777;
    margin-top: 50px;
}

/* Kategori Utama Styling */
.category-block {
    background-color: #ffffff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

.category-header:hover {
    background-color: #e0e0e0;
}

.category-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.4em;
    color: #2c3e50;
    margin: 0;
}

.category-arrow {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.category-header.open .category-arrow {
    transform: rotate(90deg);
}

/* Info Kategori Utama Styling */
.category-info {
    padding: 15px 25px 5px 25px;
    font-size: 0.9em;
    color: #555;
    font-style: italic;
    background-color: #f9f9f9;
    border-bottom: 1px dashed #eee;
}

/* Konten Dropdown (Kontainer Induk Sub-kategori/Item) */
.category-content {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    padding: 0 25px;
    position: relative;
}

.category-content.open {
    display: block;
}

/* Garis vertikal di dalam dropdown */
.category-content::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
}

/* Styling Sub Kategori */
.subcategory-block {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

/* Garis vertikal untuk sub-kategori (menyambung dari atas) */
.subcategory-block::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
}

.subcategory-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.2em;
    color: #444;
    margin-bottom: 8px;
}

/* Info Sub Kategori Styling */
.subcategory-info {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
    padding-left: 5px;
    border-left: 2px solid #a7d9f7;
    padding-left: 8px;
}

/* Item Styling */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

/* Garis vertikal untuk item (menyambung dari sub-kategori) */
.item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
}

.item-name {
    flex-grow: 1;
    font-size: 1em;
    color: #333;
    padding-right: 15px;
}

.item-price {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    color: #2c3e50;
    white-space: nowrap;
}

/* Tombol Info Item Styling */
.item-info-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8em;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-left: 8px;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.item-info-button:hover {
    background-color: #0056b3;
}

.item-info-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Modal/Pop-up Styling (untuk Info Tambahan) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer Styling Baru */
footer {
    background-color: #333;
    color: #bbb;
    text-align: center;
    padding: 8px 0;
    font-size: 0.85em;
    flex-shrink: 0;
    margin-top: auto;
}

footer p {
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    header p {
        font-size: 1em;
    }
    .category-title {
        font-size: 1.2em;
    }
    .subcategory-title {
        font-size: 1.1em;
    }
    .item-name, .item-price {
        font-size: 0.95em;
    }
    .category-header {
        padding: 15px 20px;
    }
    .category-info {
        padding: 10px 20px 5px 20px;
    }
    .category-content {
        padding: 0 20px;
    }
    .category-content::before {
        left: 15px;
    }
    .subcategory-block {
        padding-left: 20px;
    }
    .subcategory-block::before {
        left: 0px;
    }
    .item {
        padding-left: 20px;
    }
    .item::before {
        left: 0px;
    }
    .search-box {
        max-width: 90%;
    }
}
