/* File: public/style.css */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

h1, h2 {
    color: #333;
}

/* --- Kartu Produk --- */
#product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden; 
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.product-card img {
    width: 100%;
    height: 180px; 
    object-fit: cover; 
    display: block;
}
.product-info {
    padding: 15px;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}
.product-card h3 {
    font-size: 1.1em;
    margin: 0 0 10px 0; 
    color: #333;
    flex-grow: 1; 
}
.product-card .price {
    font-weight: bold;
    font-size: 1.2em;
    color: #D94A00; 
    margin-bottom: 15px;
}
.product-card button {
    background-color: #FF7B00; 
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    width: 100%; 
}
.product-card button:hover {
    background-color: #D94A00; 
}

.header-bar {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px; 
    margin-bottom: 25px; 
}

.header-logo {
    height: 50px; 
    width: auto; 
    margin-right: 15px; 
    object-fit: contain; 
    flex-shrink: 0; 
}

.header-bar h1 {
    margin: 0; 
    font-size: 1.8em; 
    color: #333;
    flex-grow: 1; 
    text-align: left; 
    line-height: 1.2; 
}

#cart-icon-button {
    background-color: #f0f0f0;
    color: #333;
    font-size: 1em;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: background-color 0.2s;
    white-space: nowrap; 
    flex-shrink: 0; 
}
#cart-icon-button:hover {
    background-color: #e0e0e0;
}

/* --- Gaya Modal (Berlaku untuk SEMUA modal) --- */
.modal-overlay {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); 
    display: none; 
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 650px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.close-modal-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}
.close-modal-button:hover,
.close-modal-button:focus {
    color: black;
}

/* --- Isi Modal Keranjang Belanja --- */
#modal-cart-items {
    max-height: 50vh; 
    overflow-y: auto;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    margin-top: 15px;
}
.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5px;
    border-bottom: 1px solid #f4f4f4;
}
.cart-item-row:last-child { border-bottom: none; }
.cart-item-row img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}
.cart-item-info {
    flex-grow: 1; 
}
.cart-item-info b {
    display: block; 
}
.cart-item-info span {
    display: block;
    font-size: 0.9em;
    color: #555;
}
.cart-item-details {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.quantity-controls {
    display: flex;
    align-items: center;
    margin-left: 10px;
}
.quantity-controls button {
    background-color: #eee;
    border: 1px solid #ccc;
    color: #333;
    width: 30px;
    height: 30px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}
.quantity-controls input {
    width: 40px;
    text-align: center;
    border: 1px solid #ccc;
    height: 28px;
    margin: 0 5px;
    border-radius: 4px;
    -moz-appearance: textfield;
}
.quantity-controls input::-webkit-outer-spin-button,
.quantity-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.item-subtotal {
    margin-left: 15px;
    min-width: 90px;
    text-align: right;
    font-size: 1.1em;
}
.remove-item-button {
    background: none;
    border: none;
    color: #ff0000;
    font-size: 1.5em; 
    font-weight: bold;
    cursor: pointer;
    margin-left: 15px;
    padding: 0 5px;
}
.remove-item-button:hover { color: #cc0000; }

/* --- Footer Modal (Berlaku untuk SEMUA modal) --- */
.modal-footer {
    margin-top: 20px;
    text-align: right;
}
.modal-footer h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
    text-align: left; 
}
.modal-footer input[type="text"],
.modal-footer select {
    display: block;
    width: calc(100% - 20px); 
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em; 
}
.modal-footer select:invalid {
    color: #777;
}
.modal-footer button { 
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    background-color: #FF7B00; 
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.modal-footer button:hover {
    background-color: #D94A00;
}

/* --- Gaya Form Opsi Produk (Modal Baru) --- */
.options-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.options-form label {
    font-weight: bold;
    margin-bottom: -5px;
}
.options-form select,
.options-form input[type="text"] {
    width: calc(100% - 20px); 
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

/* --- Halaman Status Order (sudah dihapus) --- */
/* #order-status { ... } */

/* --- Tombol Konfirmasi & Validasi --- */
.confirm-button {
    background-color: #28a745; 
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.2s;
}
.confirm-button:hover {
    background-color: #218838; 
}

#alert-modal .modal-content {
    padding-bottom: 30px; 
}
#alert-modal h2 {
    color: #dc3545; 
    margin-bottom: 10px;
}
#alert-ok-button {
    width: 80%; 
    margin: 0 auto; 
    display: block;
    background-color: #007bff; 
}
#alert-ok-button:hover {
    background-color: #0056b3; 
}

#qris-modal .modal-content {
    padding-bottom: 30px; 
}
#qris-modal h2 { 
    margin-bottom: 15px;
    color: #333;
}
#qris-modal p {
    margin: 8px 0;
}
#qris-image-container {
    margin: 15px 0;
}
#confirm-payment-modal-button { 
    width: 80%; 
    margin: 15px auto 0 auto; 
    display: block;
}

#validation-modal .modal-content {
    padding-bottom: 30px;
}
#validation-modal h2 {
    color: #dc3545; 
    margin-bottom: 10px;
}
#validation-message {
    color: #333; 
}
.validation-button {
    background-color: #007bff; 
    color: white;
    border: none;
    padding: 10px 25px; 
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em; 
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.2s;
    width: 50%; 
    margin: 15px auto 0 auto;
    display: block;
}
.validation-button:hover {
    background-color: #0056b3; 
}