/* =========================================================
   MedStore - Storefront styles
   Palette: deep teal/green (trust, care) + warm amber accent
   Type: Newsreader (headings) + Inter (body/UI)
========================================================= */

:root {
    --bg: #F7F9F7;
    --surface: #FFFFFF;
    --primary: #175E4C;
    --primary-dark: #0F4438;
    --primary-tint: #E7F1EC;
    --accent: #E8A33D;
    --accent-dark: #C9821E;
    --text: #1F2A24;
    --text-muted: #5C6B63;
    --border: #E0E6E2;
    --danger: #B3432E;
    --radius: 6px;
    --font-display: 'Newsreader', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.5em;
    color: var(--primary-dark);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; max-width: 65ch; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #2b1c00; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-tint); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Header / Nav ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}
.logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 28px; align-items: center; }
.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: var(--primary); border-bottom-color: var(--accent); }
.nav-cart {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-tint);
    color: var(--primary-dark);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
}
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--primary); }

@media (max-width: 860px) {
    .main-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 24px 24px;
        border-bottom: 1px solid var(--border);
        display: none;
        gap: 14px;
    }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
    padding: 72px 0;
    background: linear-gradient(180deg, var(--primary-tint) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}
.hero-eyebrow {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 14px;
}
.hero h1 { margin-bottom: 20px; }
.hero p.lead { font-size: 1.1rem; color: var(--text-muted); }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-art {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
}
.hero-image {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4/3;
    position: relative;
    box-shadow: 0 20px 40px -20px rgba(15, 68, 56, 0.35);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-image .float-badge {
    position: absolute;
    bottom: 18px;
    left: 18px;
    background: var(--surface);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(15,68,56,0.18);
    display: flex;
    align-items: center;
    gap: 10px;
}
.hero-image .float-badge .dot {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-tint); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.hero-image .float-badge b { display: block; font-size: 0.85rem; color: var(--primary-dark); }
.hero-image .float-badge span { font-size: 0.78rem; color: var(--text-muted); }

.hero-stats { display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.hero-stat b { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--primary); }
.hero-stat span { color: var(--text-muted); font-size: 0.88rem; }

@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Promo banner strip ---------- */
.promo-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.promo-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--border);
}
.promo-card img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.promo-card::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(15,68,56,0) 30%, rgba(9,38,31,0.82) 100%);
    z-index: 1;
}
.promo-card .promo-body { position: relative; z-index: 2; padding: 20px; color: #fff; }
.promo-card .promo-body span { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: #CFE7DC; }
.promo-card .promo-body h3 { color: #fff; margin: 4px 0 10px; font-size: 1.15rem; }
.promo-card .promo-body a { font-size: 0.85rem; font-weight: 600; color: #fff; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

@media (max-width: 860px) { .promo-strip { grid-template-columns: 1fr; } }

/* ---------- Page banner (About / Shop / Blog header image) ---------- */
.page-banner {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.page-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.page-banner::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(15,68,56,0.92) 0%, rgba(15,68,56,0.55) 55%, rgba(15,68,56,0.25) 100%);
    z-index: 1;
}
.page-banner .container { position: relative; z-index: 2; }
.page-banner .breadcrumb { color: #CFE7DC; }
.page-banner .breadcrumb a { color: #fff; }
.page-banner h1 { color: #fff; }
.page-banner p.lead { color: #E4F1EB; max-width: 520px; }

/* ---------- Rounded feature image (About / Contact) ---------- */
.feature-image {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px -24px rgba(15, 68, 56, 0.35);
}
.feature-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; gap: 20px; flex-wrap: wrap; }
.section-head p { color: var(--text-muted); margin: 0; }

/* ---------- Feature strip ---------- */
.feature-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.feature-card .icon { font-size: 1.6rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

@media (max-width: 860px) { .feature-strip { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feature-strip { grid-template-columns: 1fr; } }

/* ---------- Product grid / cards ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-card .thumb {
    aspect-ratio: 1 / 1;
    background: var(--primary-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { font-size: 1rem; margin: 0; }
.product-card .rx-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--danger);
    background: #FBEAE6;
    padding: 2px 8px;
    border-radius: 999px;
    width: fit-content;
}
.product-card .price-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 10px; }
.price { font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; }
.price .was { color: var(--text-muted); font-weight: 400; text-decoration: line-through; font-size: 0.85rem; margin-right: 6px; }
.product-card form { margin: 0; }

/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 860px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .blog-grid { grid-template-columns: 1fr; } }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.post-card .thumb { aspect-ratio: 16/10; background: var(--primary-tint); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 18px; }
.post-card .cat { color: var(--primary); font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; display: block; }
.post-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.post-card p { color: var(--text-muted); font-size: 0.92rem; }
.post-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; width:47%; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-color: var(--primary);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.92rem; }
.alert-success { background: #E4F3EA; color: #1E6A3E; border: 1px solid #BFE3CC; }
.alert-error { background: #FBEAE6; color: var(--danger); border: 1px solid #F1C7BE; }

/* ---------- Cart / Checkout ---------- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.cart-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-item-name { display: flex; align-items: center; gap: 12px; }
.cart-item-name img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.qty-input { width: 64px; padding: 6px 8px; }
.cart-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.cart-summary .total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); padding-top: 10px; }

.payment-options { display: flex; flex-direction: column; gap: 12px; }
.payment-option {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
}
.payment-option input { margin-right: 10px; }

/* ---------- Product variation picker (e.g. pill count) ---------- */
.variation-options { display: flex; flex-direction: row; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.variation-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.variation-option:hover { border-color: var(--primary); }
.variation-option.selected { border-color: var(--primary); background: var(--primary-tint); }
.variation-option input[type="radio"] { margin-right: 12px; width:auto; }
.variation-option .variation-label { flex: 1; font-weight: 600; font-size: 0.95rem; }
.variation-option .variation-price { font-weight: 700; color: var(--primary-dark); }
.bank-details-box {
    background: var(--primary-tint);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    font-size: 0.92rem;
    display: none;
}
.bank-details-box.show { display: block; }
.bank-details-box p { margin: 4px 0; }

/* ---------- Checkout layout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-dark); color: #DCEAE4; padding: 56px 0 24px; margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.site-footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 14px; }
.site-footer a, .site-footer p { color: #B9D2C8; font-size: 0.9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 20px; text-align: center; font-size: 0.85rem; color: #9DBBAF; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Misc pages (About / Contact) ---------- */
.page-hero { padding: 48px 0; background: var(--primary-tint); border-bottom: 1px solid var(--border); text-align: left; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.breadcrumb { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 16px; }
.breadcrumb a { color: var(--primary); }

.empty-state { text-align: center; padding: 64px 24px; color: var(--text-muted); }

.pagination { display: flex; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
