@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Fallbacks */
    --primary: #6366f1;
    --secondary: #64748b;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --shadow-soft: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modern Accents */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

::selection {
    background: var(--primary);
    color: white;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--primary);
}

.search-bar {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    padding-left: 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 99px;
    background: var(--gray-100);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 90%);
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Hero Section */
.hero {
    margin: 2rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.hero-slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* Section Headings */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-left: 1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--primary);
    border-radius: 4px;
}

.view-all {
    font-size: 0.9rem;
    color: var(--primary);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 1px solid transparent;
    /* Prevent layout shift */
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--primary);
    /* Accent border on hover */
}

.product-image {
    height: 220px;
    width: 100%;
    overflow: hidden;
    background: var(--gray-100);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1rem;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary), transparent 70%);
}

.btn-full {
    width: 100%;
}

/* Product Detail */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.detail-gallery {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.detail-info {
    padding: 1rem 0;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.detail-price {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.detail-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.variant-selector {
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
    background: var(--white);
}

.variant-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.variant-option:hover {
    border-color: var(--primary);
}

.variant-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Checkout */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.checkout-summary {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 90px;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.75rem 0;
    border-top: 1px solid var(--gray-100);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {

    .nav-links,
    .search-bar {
        display: none;
    }

    .product-detail-layout,
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .mobile-nav {
        display: flex;
    }

    body {
        padding-bottom: 70px;
        /* Space for mobile nav */
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .hero-slide img {
        height: 250px;
    }

    /* Checkout Page Mobile Responsive */
    .container {
        padding: 0 0.75rem;
    }

    .section-title {
        font-size: 1.25rem;
        margin-top: 1rem !important;
        margin-bottom: 1rem;
        padding-left: 0.75rem;
    }

    .section-title::before {
        width: 3px;
    }

    /* Buyer Info & Payment Detail */
    .buyer-info,
    .payment-detail {
        padding: 0;
    }

    .buyer-info h3,
    .payment-detail h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* Form Groups */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .form-control {
        padding: 0.65rem;
        font-size: 0.95rem;
    }

    /* Payment Detail Box */
    .payment-detail>div {
        padding: 1rem !important;
    }

    /* Voucher Section - Stack vertically on mobile */
    .voucher-input-group {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .payment-detail button[onclick="applyVoucher()"] {
        width: 100%;
        padding: 0.75rem !important;
    }

    /* Product Summary */
    .payment-detail div[style*="justify-content: space-between"] {
        font-size: 0.85rem !important;
    }

    .payment-detail div[style*="font-size: 1.2rem"] {
        font-size: 1.1rem !important;
    }

    /* Total Bayar */
    #totalBayar {
        font-size: 1.1rem !important;
    }

    /* Buyer Data Info Box */
    div[style*="background: #f0f9ff"] {
        padding: 0.75rem !important;
        margin-bottom: 1rem !important;
        grid-column: span 1 !important;
    }

    div[style*="background: #f0f9ff"] h4 {
        font-size: 0.9rem !important;
    }

    div[style*="background: #f0f9ff"] ul {
        font-size: 0.85rem !important;
    }

    /* Checkbox & Terms */
    .payment-detail div[style*="font-size: 0.85rem"] {
        font-size: 0.8rem !important;
    }

    /* Submit Button */
    .btn-primary.btn-full {
        padding: 0.85rem !important;
        font-size: 0.95rem !important;
    }

    /* WhatsApp Notice */
    .payment-detail div[style*="text-align: center"] {
        font-size: 0.75rem !important;
        margin-top: 0.75rem !important;
    }

    /* Sticky positioning adjustment for mobile */
    .checkout-summary {
        position: relative;
        top: 0;
    }
}