/* ═══════════════════════════════════════
   STOREFRONT — Master CSS
   ═══════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: var(--bg, #fff);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: #999; font-size: 13px; }

/* ─── TOP NAV ─── */
.top-nav {
    background: var(--primary, #1a1a2e);
    color: #ccc;
    font-size: 12px;
    letter-spacing: 1px;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
}

.nav-links { display: flex; gap: 18px; }
.nav-links a { color: #ccc; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }

/* ─── HEADER ─── */
.header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 14px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-img { height: 44px; }
.logo-text { font-size: 22px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
    border: 2px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}

.search-bar button {
    border: none;
    background: var(--accent, #e94560);
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 16px;
}

.header-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.free-ship { font-size: 12px; color: #666; }
.cart-btn {
    background: var(--primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

/* ─── HERO ─── */
.hero {
    padding: 60px 0;
    text-align: center;
    color: #fff;
}

.hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: 0.85; margin-bottom: 24px; }

.hero-btn {
    display: inline-block;
    background: var(--accent, #e94560);
    color: #fff;
    padding: 14px 40px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.hero-btn:hover { background: #d63a54; }

/* ─── SECTIONS ─── */
.section { padding: 48px 0; }

.section-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 32px;
    color: var(--primary);
}

/* ─── PRODUCT GRID ─── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.product-img {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder { font-size: 48px; color: #ddd; }

.product-info { padding: 14px 16px; }
.product-name { font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #333; line-height: 1.3; }
.product-rating { font-size: 12px; margin-bottom: 6px; }
.product-price { font-size: 16px; font-weight: 700; color: var(--primary); }

/* ─── PRODUCT DETAIL ─── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.pd-main-img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #eee;
}

.pd-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.pd-thumb {
    width: 64px; height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #eee;
    cursor: pointer;
}
.pd-thumb:hover { border-color: var(--accent); }
.pd-no-img { font-size: 64px; color: #ddd; text-align: center; padding: 60px; }

.pd-title { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.pd-rating { margin-bottom: 12px; font-size: 14px; }
.pd-price { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.pd-compare-price { margin-bottom: 12px; color: #999; }
.pd-compare-price s { margin-right: 8px; }
.pd-discount { color: var(--accent); font-weight: 600; }
.pd-short { color: #666; margin-bottom: 16px; line-height: 1.6; }

.pd-qty { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.pd-qty input {
    width: 70px; padding: 8px;
    border: 2px solid #eee; border-radius: 8px;
    text-align: center; font-size: 15px;
}

.btn-add-cart {
    display: block; width: 100%;
    padding: 14px; border: none;
    background: var(--accent); color: #fff;
    font-size: 16px; font-weight: 700;
    border-radius: 10px; cursor: pointer;
    letter-spacing: 1px;
    transition: background 0.2s;
}
.btn-add-cart:hover { background: #d63a54; }

.pd-trust {
    display: flex; gap: 16px;
    margin-top: 16px; font-size: 13px; color: #666;
}

.pd-desc { margin-top: 24px; }
.pd-desc h3 { margin-bottom: 8px; }

/* ─── CART ─── */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: 12px; border-bottom: 1px solid #eee; text-align: left; }
.cart-table th { font-size: 12px; text-transform: uppercase; color: #888; }

.cart-summary { text-align: right; margin-top: 20px; }
.cart-total { font-size: 22px; font-weight: 700; margin-bottom: 16px; }

.btn-checkout {
    display: inline-block;
    background: var(--accent); color: #fff;
    padding: 14px 40px; border-radius: 10px;
    font-weight: 700; font-size: 15px;
}

/* ─── CHECKOUT ─── */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }

.checkout-form input, .checkout-form textarea, .checkout-form select {
    width: 100%; padding: 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 14px; margin-bottom: 12px;
}

.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.payment-methods { display: flex; gap: 10px; margin-bottom: 16px; }
.payment-btn {
    flex: 1; padding: 12px; border: 2px solid #eee;
    border-radius: 8px; background: #fff; cursor: pointer;
    font-size: 14px; font-weight: 600;
}
.payment-btn.active { border-color: var(--accent); background: #fef2f2; }

.card-input { padding: 14px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 16px; }

.btn-place-order {
    display: block; width: 100%;
    padding: 16px; border: none;
    background: var(--accent); color: #fff;
    font-size: 16px; font-weight: 700;
    border-radius: 10px; cursor: pointer;
}

.checkout-summary {
    background: #fafafa; border-radius: 12px;
    padding: 20px; border: 1px solid #eee;
}
.checkout-total { font-size: 22px; font-weight: 700; margin-top: 16px; padding-top: 16px; border-top: 1px solid #eee; }

/* ─── FOOTER ─── */
.footer { background: #fafafa; border-top: 1px solid #eee; margin-top: 48px; }

.trust-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    padding: 40px 0;
}

.trust-item { text-align: center; }
.trust-icon { font-size: 24px; margin-bottom: 6px; }
.trust-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.trust-desc { font-size: 12px; color: #888; }

.newsletter { text-align: center; padding: 32px 0; border-top: 1px solid #eee; }
.newsletter h3 { font-size: 16px; margin-bottom: 16px; color: #333; }
.newsletter-form { display: flex; gap: 10px; max-width: 500px; margin: 0 auto; }
.newsletter-form input {
    flex: 1; padding: 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 14px;
}
.newsletter-form button {
    padding: 12px 28px; background: var(--primary);
    color: #fff; border: none; border-radius: 8px;
    font-weight: 700; cursor: pointer; letter-spacing: 1px;
}

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; border-top: 1px solid #eee;
    font-size: 13px; color: #888;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #888; }
.footer-links a:hover { color: #333; }

/* ─── MISC ─── */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.btn {
    display: inline-block; padding: 10px 20px;
    border: 1px solid #ddd; border-radius: 8px;
    font-size: 14px; cursor: pointer; background: #fff;
}
.btn:hover { background: #f5f5f5; }
.pagination { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 32px; }
.page-content { max-width: 800px; margin: 0 auto; }
.page-text { line-height: 1.7; color: #555; }

.contact-form-wrap { max-width: 600px; margin: 0 auto; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 14px; margin-bottom: 12px;
}
.btn-submit {
    padding: 14px 32px; background: var(--accent);
    color: #fff; border: none; border-radius: 8px;
    font-weight: 700; cursor: pointer;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .search-bar { order: 3; max-width: 100%; flex-basis: 100%; }
    .free-ship { display: none; }
    .product-detail { grid-template-columns: 1fr; }
    .checkout-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 26px; }
}
