/* css/style.css */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #333;
    --border-color: #ddd;
    --card-bg: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 16px var(--shadow-color);
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 40px;
    font-weight: 700;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.product-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.product-card h3 {
    color: var(--dark-bg);
    margin-bottom: 15px;
    font-weight: 600;
}

.product-card .price {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-card .price small {
    font-size: 0.6em;
    color: var(--secondary-color);
}

.product-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 25px;
    flex-grow: 1; /* Agar daftar fitur mengambil ruang yang tersedia */
}

.product-card ul li {
    margin-bottom: 10px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card ul li i {
    color: var(--success-color);
    margin-right: 8px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 6px solid var(--border-color);
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 10px 20px var(--shadow-color);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

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

.close-button {
    color: var(--secondary-color);
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--dark-bg);
    text-decoration: none;
}

#modal-product-name {
    color: var(--primary-color);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
}

#modal-product-description {
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-color);
}

#modal-pricing div {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--dark-bg);
}

#modal-pricing .price-amount {
    font-size: 1.3em;
    color: var(--primary-color);
}

#modal-order-button {
    display: block;
    margin: 30px auto 0 auto;
    width: fit-content;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 20px auto;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .modal-content {
        width: 90%;
        padding: 20px;
    }
    h1 {
        font-size: 1.8em;
    }
}