/* File: assets/css/main.css */
:root {
    /* Default variables, will be overridden by inline styles */
    --primary-color: #007bff;
    --button-color: #007bff;
    --text-color: #333333;
    --bg-color: #f0f2f5;
}

/* RESET */
*{
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin:0;padding:0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* OVERLAY */
/* body::before{
    content:'';
    position:fixed;
    inset:0;
    background:linear-gradient(180deg,rgba(44, 44, 44, 0.75),rgba(51, 51, 51, 0.65));
    z-index:0;
} */

/* PAGE */
.page{position:relative;z-index:1}

/* Mobile Container Limit */
.container {
    /* max-width: 420px; */ /* Lebar optimal HP */
    max-width:1200px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    background: transparent;
}

.text-center { text-align: center; }

/* Header Styling */
header {
    color:#fff;
    margin-bottom: 24px;
    padding-top: 10px;
}

.app-logo {
    max-height: 60px;
    margin-bottom: 12px;
}

.app-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.subtitle {
    font-size: 14px;
    opacity:.85;
    margin: 0;
}

/* Paket Grid */
.paket-grid {
    display: grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap: 16px;
    justify-content:center;
}

@media (min-width: 768px) {
    .paket-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
    }
}

/* Card Style - App Like */
.paket-item {
    background:linear-gradient(135deg,#ffffff,#f9fafb);
    border-radius: 16px;
    padding: 20px;
    display:flex;
    flex-direction:column;
    box-shadow:0 25px 50px rgba(0,0,0,.35);
    transition: transform 0.2s;
    margin-inline:auto;
}
.paket-item:hover{transform:translateY(-6px)}
    position: relative;
    overflow: hidden;
}

.paket-item:active {
    transform: scale(0.98);
}

.paket-item h3 {
    margin: 0 0 8px 0;
    font-weight: 700;
    font-size: 18px;
}

.paket-item .durasi {
    opacity:.65;
    margin: 0;
    font-size: 13px;
    background: #f1f3f5;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.paket-item .harga {
    color: var(--primary-color);
    margin:14px 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.paket-item .keterangan {
    font-size:14px;
    opacity:.85;
    margin-bottom:22px;
    line-height: 1.4;
}

/* Tombol Besar & Full Width */
.btn-beli {
    margin-top:auto;
    background: var(--button-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
    padding:16px;
}

.btn-beli:active { opacity: 0.8; }

/* Modal Styles - Bottom Sheet (Muncul dari Bawah) */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    align-items: flex-end; /* Align ke bawah */
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    width:100%;
    max-width: 100%; /* Full width di mobile */
    border-radius: 24px 24px 0 0; /* Rounded atas saja */
    padding: 24px;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Desktop Modal Adjustments */
@media (min-width: 768px) {
    .modal {
        align-items: center; /* Tengah secara vertikal */
    }

    .modal-content {
        max-width: 450px; /* Lebar fixed di desktop */
        border-radius: 16px; /* Rounded semua sisi */
        transform: scale(0.95);
        transition: transform 0.2s ease;
    }

    .modal.show .modal-content {
        transform: scale(1);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: #f1f3f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    color: #333;
    cursor: pointer;
    padding: 0;
}

.modal h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
}

.summary {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.summary p {
    margin: 6px 0;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px 16px; /* Padding besar untuk jari */
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 16px; /* Mencegah zoom di iOS */
    background: #fff;
    outline: none;
    -webkit-appearance: none; /* Reset style native */
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-bayar {
    flex: 2;
    background: #28a745;
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.btn-batal {
    flex: 1;
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

/* ===============================
   MOBILE FIX
================================ */
@media (max-width:600px){
    .paket-grid{
        grid-template-columns:1fr;
    }
    .paket-item{
        max-width:360px;   /* 🔥 KARTU TENGAH */
        width:100%;
    }
}