/**
 * Tema Global - Ceria & Modern
 * Cocok untuk semua halaman, responsive desktop & mobile
 */

/* ========== FONT ========== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ========== VARIABEL WARNA CERIA & MODERN ========== */
:root {
    /* Primary - Teal segar (cocok dengan banyak logo) */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --primary-50: #f0fdfa;
    
    /* Accent - Amber hangat (ceria) */
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-light: #fef3c7;
    
    /* Netral */
    --white: #ffffff;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Semantic */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Shadow & radius */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Legacy mapping untuk kompatibilitas */
    --primary-color: var(--text);
    --secondary-color: var(--primary);
    --accent-color: var(--accent);
    --text-color: var(--text);
    --background-light: var(--bg-page);
    --border-color: var(--border);
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ========== HEADER & NAV - CERIA, BERSIH ========== */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--primary-dark);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    z-index: 1001;
}

.logo img {
    height: 42px;
    width: auto;
    margin-right: 0.6rem;
    border-radius: 10px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.25rem;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-50);
}

/* Tombol CTA di nav (Login/Daftar) bisa pakai class .btn-nav */
.nav-links .btn-primary {
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: var(--primary-50);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--primary-light);
}

.mobile-menu-btn span {
    width: 22px;
    height: 2.5px;
    background: var(--primary-dark);
    border-radius: 2px;
    margin: 0 auto;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(-45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(45deg);
}

/* ========== HERO - CERIA & IMPACT ========== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #14b8a6 50%, #2dd4bf 100%);
    color: var(--white);
    text-align: center;
    padding: 4rem 0 4.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='20' cy='20' r='1.5'/%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.hero p {
    font-size: clamp(0.9375rem, 2vw, 1.125rem);
    opacity: 0.95;
    max-width: 520px;
    margin: 0 auto 1.75rem;
    line-height: 1.6;
}

.hero .btn-primary {
    background: var(--white);
    color: var(--primary-dark);
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    border: none;
}

.hero .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
    background: var(--primary-50);
    color: var(--primary-dark);
}

/* ========== SECTION & TYPOGRAPHY ========== */
.section {
    padding: 3.5rem 0;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: 800;
    color: var(--text);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-50);
    border-color: var(--primary);
}

/* ========== PRODUCT CARDS ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--border-light);
}

.product-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: var(--primary-50);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    align-self: flex-start;
    margin-bottom: 0.5rem;
}

/* Judul kartu: ringkas, tidak terlalu besar (tanpa deskripsi di listing) */
.product-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.65rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 0;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.85rem;
    margin-top: auto;
}

.product-card .btn-primary {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    margin-top: 0;
}

/* ========== FILTER SECTION ========== */
.filter-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 180px;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-50);
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

.pagination .current {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ========== FOOTER ========== */
.footer {
    background: linear-gradient(180deg, #0f766e 0%, #0d9488 100%);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.footer-section a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.75);
}

/* ========== ABOUT SECTION ========== */
.about-lead {
    max-width: 640px;
    margin: 0 auto 1rem;
    text-align: center;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.about-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 2rem auto 0;
}

.about-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.about-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.about-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
    z-index: 999;
}

.back-to-top:hover {
    transform: translateY(-3px);
    color: var(--white);
}

/* ========== ANIMATION ========== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* ========== FOCUS (A11y) ========== */
.btn:focus-visible,
.form-control:focus-visible,
.nav-links a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========== RESPONSIVE - MOBILE FIRST ========== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 5rem 1rem 2rem;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links a {
        font-size: 1.125rem;
        padding: 0.75rem 1.5rem;
        width: 100%;
        max-width: 280px;
        text-align: center;
        border-radius: 12px;
    }

    .nav-links a:hover {
        background: var(--primary-50);
    }

    .hero {
        padding: 3rem 0 3.5rem;
    }

    .hero h1 {
        font-size: 1.65rem;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .form-group {
        min-width: auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .container {
        padding: 0 1rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2.5rem 0 3rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.9375rem;
    }

    .section-title {
        font-size: 1.375rem;
    }

    .product-info {
        padding: 1rem;
    }

    .filter-section {
        padding: 1.25rem;
    }
}

body.menu-open {
    overflow: hidden;
}

/* ========== AUTH PAGES (Login, Register, OTP) - CERIA & MODERN ========== */
body.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-50) 0%, #e0f2fe 50%, var(--primary-light) 100%);
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--white);
    padding: 2.25rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.auth-header p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.auth-header .admin-hint {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--accent-dark);
    background: var(--accent-light);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.auth-page .form-group {
    margin-bottom: 1.15rem;
}

.auth-page .form-label {
    font-size: 0.9375rem;
    margin-bottom: 0.4rem;
}

.auth-page .form-control {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
}

.auth-page .btn-primary {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    border-radius: 12px;
    background: var(--primary);
}

.auth-page .btn-primary:hover {
    background: var(--primary-dark);
}

.otp-method-selector {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.otp-method-selector label {
    flex: 1;
    min-width: 120px;
    background: var(--bg-page);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    border: 2px solid var(--border);
    transition: all 0.2s;
}

.otp-method-selector input {
    accent-color: var(--primary);
}

.otp-method-selector label:hover,
.otp-method-selector input:checked + label,
.otp-method-selector label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-50);
    color: var(--primary-dark);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer .admin-link {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ========== PRINT ========== */
@media print {
    .header,
    .footer,
    .back-to-top,
    .mobile-menu-btn {
        display: none !important;
    }
    .hero {
        background: none;
        color: var(--text);
    }
}
