/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e94560;
    --bg: #f8f9fa;
    --white: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --success: #28a745;
    --danger: #dc3545;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; }

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

/* Banner */
.banner {
    text-align: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}
.banner a { text-decoration: underline; }

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-size: 24px; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.cart-link { position: relative; }
.cart-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--accent);
    color: var(--white);
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-large { padding: 14px 28px; font-size: 16px; }

/* Flash Messages */
.flash-messages { margin: 20px 0; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

/* Shop Layout */
.shop-header { padding: 40px 0 20px; }
.shop-header h1 { font-size: 32px; }

.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 30px; padding-bottom: 60px; }

.shop-filters h3 { margin-bottom: 16px; font-size: 16px; }
.filter-group { margin-bottom: 24px; }
.filter-group h4 { font-size: 13px; color: var(--text-light); text-transform: uppercase; margin-bottom: 8px; }
.filter-link {
    display: block;
    padding: 6px 12px;
    color: var(--text);
    border-radius: 4px;
    font-size: 14px;
}
.filter-link:hover { background: var(--white); }
.filter-link.active { background: var(--primary); color: var(--white); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-card a { display: block; }

.product-image { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.product-image-placeholder { width: 100%; aspect-ratio: 4/3; background: linear-gradient(135deg, #e0e0e0, #f5f5f5); }
.product-image-placeholder.large { height: 400px; }

.product-info { padding: 16px; }
.product-category { font-size: 12px; color: var(--accent); text-transform: uppercase; font-weight: 600; }
.product-name { font-size: 16px; margin: 4px 0 8px; color: var(--text); }
.product-description { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }

.product-price { display: flex; align-items: center; gap: 8px; }
.price-current { font-size: 18px; font-weight: 700; color: var(--primary); }
.price-compare { font-size: 14px; color: var(--text-light); text-decoration: line-through; }

.add-to-cart-form { padding: 0 16px 16px; }
.add-to-cart-form .btn { width: 100%; text-align: center; }
.add-to-cart-form.detail { display: flex; align-items: end; gap: 16px; margin-top: 24px; }
.add-to-cart-form.detail .btn { width: auto; }

.no-products { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--text-light); }

/* Product Hero */
.product-hero {
    background: var(--primary);
    color: #fff;
    padding: 60px 0;
}
.product-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.product-hero-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.product-image-placeholder.large { height: 400px; background: rgba(255,255,255,0.1); border-radius: 12px; }

.product-category-hero {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 12px;
}
.product-hero-info h1 {
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 16px;
}
.product-price-hero { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.price-current-hero { font-size: 32px; font-weight: 800; color: #fff; }
.price-compare-hero { font-size: 20px; color: rgba(255,255,255,0.5); text-decoration: line-through; }
.product-short-desc-hero { color: rgba(255,255,255,0.8); font-size: 16px; line-height: 1.6; margin-bottom: 20px; }

.product-bullets-hero {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}
.product-bullets-hero li {
    padding: 6px 0 6px 28px;
    position: relative;
    color: rgba(255,255,255,0.9);
    font-size: 15px;
}
.product-bullets-hero li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.btn-hero {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 16px 36px;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-hero:hover { opacity: 0.92; transform: translateY(-1px); color: #fff; }

/* Bottom CTA */
.product-cta-bottom {
    background: var(--primary);
    color: #fff;
    padding: 40px 0;
    margin-top: 40px;
}
.cta-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}
.cta-bottom-inner h2 { color: #fff; font-size: 22px; }

/* Field errors */
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* Legacy badge (kept for admin use) */
.product-type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 12px 0;
}
.badge-digital { background: #e3f2fd; color: #1565c0; }
.badge-physical { background: #e8f5e9; color: #2e7d32; }
.badge-course { background: #fce4ec; color: #c62828; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; padding: 20px 0 60px; }

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}
.cart-item-image { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.cart-item-image-placeholder { width: 80px; height: 80px; background: #eee; border-radius: 4px; }
.cart-item-info { flex: 1; }
.cart-item-info h3 { font-size: 15px; }
.cart-item-price { color: var(--text-light); font-size: 14px; }
.cart-item-quantity input { width: 60px; padding: 6px; border: 1px solid var(--border); border-radius: 4px; text-align: center; }
.cart-item-total { font-weight: 700; min-width: 80px; text-align: right; }
.btn-remove { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); padding: 4px 8px; }
.btn-remove:hover { color: var(--danger); }

/* Cart Summary */
.cart-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 80px;
}
.cart-summary h3 { margin-bottom: 16px; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; }
.summary-line.discount { color: var(--success); }
.summary-line.total { border-top: 2px solid var(--primary); padding-top: 12px; font-size: 18px; font-weight: 700; }
.btn-remove-coupon { background: none; border: none; cursor: pointer; color: var(--danger); margin-left: 8px; }

.coupon-form { display: flex; gap: 8px; margin: 16px 0; }
.coupon-input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); text-transform: uppercase; }

.checkout-form { margin-top: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.btn-checkout { width: 100%; text-align: center; margin-top: 8px; }

.empty-cart { text-align: center; padding: 80px 0; }
.empty-cart p { margin-bottom: 20px; color: var(--text-light); font-size: 18px; }

/* Order Summary */
.order-summary { max-width: 700px; margin: 40px auto; padding-bottom: 60px; }
.order-success { text-align: center; padding: 30px; background: #d4edda; border-radius: var(--radius); margin-bottom: 30px; }
.order-success h1 { color: #155724; }
.order-pending { text-align: center; padding: 30px; background: #fff3cd; border-radius: var(--radius); margin-bottom: 30px; }
.order-meta { background: var(--white); padding: 20px; border-radius: var(--radius); margin-bottom: 20px; }
.order-meta p { margin-bottom: 4px; }

.order-items-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.order-items-table th, .order-items-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.order-items-table th { background: var(--bg); font-size: 13px; text-transform: uppercase; }
.order-items-table tfoot .total td { font-weight: 700; font-size: 16px; }
.order-items-table tfoot .discount td { color: var(--success); }

.status-paid { color: var(--success); font-weight: 600; }
.status-pending { color: #ffc107; font-weight: 600; }
.status-failed { color: var(--danger); font-weight: 600; }

.access-info { margin-top: 30px; }
.access-info h2 { margin-bottom: 16px; }
.access-item { background: #e3f2fd; padding: 20px; border-radius: var(--radius); margin-bottom: 12px; }
.access-item h3 { margin-bottom: 8px; }

/* Footer */
.footer { text-align: center; padding: 30px 0; color: var(--text-light); font-size: 13px; border-top: 1px solid var(--border); margin-top: 40px; }

/* Buy Now button on grid */
.buy-now-grid-btn { display: block; margin: 0 16px 16px; text-align: center; }

/* Product Short Description */
.product-short-desc { margin-top: 12px; color: var(--text-light); line-height: 1.6; }

/* Copy Bullets */
.product-bullets {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}
.product-bullets li {
    padding: 8px 0 8px 28px;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
}
.product-bullets li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* Buy Now */
.buy-now-form { margin-top: 24px; }
.btn-buy-now { width: 100%; max-width: 320px; text-align: center; font-size: 18px; padding: 16px 32px; }

/* Copy Modules (alternating text/image) */
.copy-modules { padding: 40px 0; }
.copy-module {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 40px 0;
}
.copy-module + .copy-module { border-top: 1px solid var(--border); }
.copy-module.module-text-right { direction: rtl; }
.copy-module.module-text-right > * { direction: ltr; }
.copy-module-text h2 { font-size: 24px; margin-bottom: 16px; color: var(--primary); }
.copy-module-text p { font-size: 15px; line-height: 1.8; color: var(--text); }
.copy-module-image img { width: 100%; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

/* Full Description */
.product-full-description { padding: 40px 0; border-top: 1px solid var(--border); }
.description-content { max-width: 800px; margin: 0 auto; line-height: 1.8; font-size: 15px; }

/* FAQs */
.product-faqs { padding: 40px 0; border-top: 1px solid var(--border); }
.product-faqs > h2 { text-align: center; font-size: 28px; margin-bottom: 24px; }
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    color: var(--text);
}
.faq-toggle { font-size: 20px; color: var(--text-light); transition: transform 0.2s; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer p { padding: 0 0 18px; line-height: 1.7; color: var(--text-light); }

/* Reviews */
.product-reviews { padding: 40px 0; border-top: 1px solid var(--border); }
.product-reviews > h2 { text-align: center; font-size: 28px; margin-bottom: 24px; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.review-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.review-stars { color: #f5a623; font-size: 16px; margin-bottom: 10px; }
.review-stars.small { font-size: 13px; }
.review-text { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.review-author { font-size: 13px; color: var(--text-light); }
.review-name { font-weight: 600; color: var(--text); }
.review-product { margin-left: 4px; }

/* Checkout Page */
.checkout-layout { display: grid; grid-template-columns: 1fr 400px; gap: 40px; padding: 30px 0 60px; }
.checkout-left h1 { margin-bottom: 24px; }
.checkout-left h2 { font-size: 18px; margin: 24px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.checkout-left h2:first-of-type { border-top: none; padding-top: 0; }
.checkout-form-full .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
}
.form-row-checkout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn-place-order { width: 100%; text-align: center; margin-top: 20px; font-size: 16px; padding: 16px; }

/* Checkout Summary */
.checkout-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 80px;
}
.checkout-product { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.checkout-product-img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.checkout-product-name { font-weight: 600; }
.checkout-product-price { color: var(--text-light); font-size: 14px; }
.summary-lines { margin-top: 16px; }

.checkout-reviews { margin-top: 20px; }
.checkout-review {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.checkout-review p { font-size: 13px; line-height: 1.5; margin: 6px 0; }
.checkout-review .review-name { font-size: 12px; color: var(--text-light); font-weight: 600; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-box {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-box h2 { font-size: 24px; margin-bottom: 12px; }
.modal-box p { color: var(--text-light); margin-bottom: 24px; line-height: 1.5; }

/* Nav logo */
.nav-logo { max-height: 40px; width: auto; display: block; }
.navbar-minimal .container { justify-content: center; }

/* Section heading */
.section-heading { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 32px; color: var(--primary); }

/* Bullets section */
.bullets-section { padding: 60px 0; }
.bullets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 40px;
    list-style: none;
    max-width: 820px;
    margin: 0 auto;
}
.bullet-item { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; }
.bullet-icon { font-size: 18px; color: var(--accent); flex-shrink: 0; line-height: 1.5; }

/* Product summary card */
.product-summary-section { padding: 60px 0; background: var(--primary); }
.product-summary-card {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.summary-card-title { font-size: 24px; font-weight: 800; margin-bottom: 24px; color: var(--primary); }
.summary-features { list-style: none; text-align: left; margin-bottom: 24px; }
.summary-features li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 15px; }
.summary-check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.summary-price { font-size: 36px; font-weight: 800; color: var(--primary); margin-bottom: 20px; display: flex; align-items: baseline; justify-content: center; gap: 12px; }
.price-compare-summary { font-size: 20px; color: var(--text-light); text-decoration: line-through; font-weight: 500; }
.btn-summary {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 700;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-summary:hover { opacity: 0.92; color: #fff; transform: translateY(-1px); }
.summary-guarantee { margin-top: 16px; font-size: 14px; color: var(--text-light); }
.guarantee-icon { margin-right: 4px; }

/* Guarantee banner */
.guarantee-section { background: #f0faf4; border-top: 1px solid #c3e6cb; border-bottom: 1px solid #c3e6cb; padding: 40px 0; }
.guarantee-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; }
.guarantee-badge { font-size: 48px; }
.guarantee-inner h3 { font-size: 20px; font-weight: 800; color: #155724; margin-bottom: 6px; }
.guarantee-inner p { color: #155724; font-size: 15px; opacity: 0.85; max-width: 500px; }

/* Responsive */
@media (max-width: 768px) {
    .shop-layout { grid-template-columns: 1fr; }
    .shop-filters { display: flex; flex-wrap: wrap; gap: 16px; }
    .filter-group { margin-bottom: 0; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .product-hero-inner { grid-template-columns: 1fr; }
    .product-hero-info h1 { font-size: 26px; }
    .cta-bottom-inner { flex-direction: column; align-items: flex-start; }
    .copy-module { grid-template-columns: 1fr; }
    .copy-module.module-text-right { direction: ltr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .bullets-grid { grid-template-columns: 1fr; }
    .guarantee-inner { flex-direction: column; text-align: center; }
}
