/* ============================================================
   THE ARTISAN SHOP — Spring Theme
   Aesthetic: Cottage-garden bloom — soft, fresh, handmade joy
   Palette: Blush · Sage · Warm cream · Peach · Sky
   Fonts: Cormorant Garamond (display) + Nunito (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Nunito:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette */
    --cream:        #fdf8f2;
    --cream-dark:   #f5ede0;
    --blush:        #f2b8c0;
    --blush-light:  #fde8ec;
    --blush-dark:   #e8919f;
    --sage:         #8aac8e;
    --sage-light:   #c8deca;
    --sage-dark:    #5e886a;
    --peach:        #f7c59f;
    --peach-light:  #fdecd9;
    --sky:          #aacfe4;
    --sky-light:    #ddf0f8;
    --lavender:     #c5b8e8;
    --text:         #3d2e28;
    --text-mid:     #7a6055;
    --text-muted:   #b09080;
    --border:       #e8d8cc;
    --border-soft:  #f0e4d8;
    --white:        #ffffff;
    --shadow-soft:  0 4px 24px rgba(180,120,100,.10);
    --shadow-card:  0 2px 16px rgba(180,120,100,.08);

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'Nunito', system-ui, sans-serif;

    /* Radii */
    --radius:       10px;
    --radius-lg:    20px;
    --radius-pill:  999px;

    /* Layout */
    --max-w: 1200px;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    background: var(--cream);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Subtle petal-dot texture */
    background-image:
        radial-gradient(circle at 15% 15%, rgba(242,184,192,.18) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(138,172,142,.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(247,197,159,.08) 0%, transparent 60%);
}

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; }
a  { color: var(--sage-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blush-dark); }
p  { margin-bottom: 1rem; }
em { font-style: italic; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container   { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.main-content { flex: 1; padding: 2rem 0 5rem; }

/* ── DECORATIVE ELEMENTS ─────────────────────────────────── */
/* Scattered petal SVG as pseudo-elements */
.petal-divider {
    text-align: center;
    color: var(--blush);
    font-size: 1.2rem;
    letter-spacing: .5rem;
    margin: 1.5rem 0;
    opacity: .6;
}

/* ── HEADER ─────────────────────────────────────────────── */
.site-header {
    background: rgba(253,248,242,.92);
    backdrop-filter: blur(16px);
    border-bottom: 1.5px solid var(--border-soft);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 20px rgba(180,120,100,.06);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: .9rem 1.5rem;
    max-width: var(--max-w); margin: 0 auto;
}
.logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--sage-dark);
    letter-spacing: .01em;
    display: flex; align-items: center; gap: .4rem;
    text-decoration: none;
}
.logo::before { content: '🌸'; font-size: 1.3rem; }
.logo:hover { color: var(--blush-dark); }

.nav-links {
    display: flex; gap: 1.5rem; align-items: center;
}
.nav-links a {
    color: var(--text-mid);
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: color .2s;
    text-decoration: none;
}
.nav-links a:hover { color: var(--blush-dark); }

.cart-link {
    background: var(--blush-light);
    border: 1.5px solid var(--blush);
    border-radius: var(--radius-pill);
    padding: .4rem .9rem;
    font-size: .88rem !important;
    color: var(--blush-dark) !important;
    display: flex; align-items: center; gap: .4rem;
    transition: all .2s !important;
}
.cart-link:hover {
    background: var(--blush) !important;
    color: var(--white) !important;
    opacity: 1 !important;
}
.cart-badge {
    background: var(--blush-dark);
    color: var(--white);
    font-size: .65rem; font-weight: 700;
    border-radius: 50%; width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    background: var(--cream-dark);
    border-top: 1.5px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
}
.footer-inner {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1rem;
    max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem;
    font-size: .85rem; color: var(--text-muted);
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); font-size: .82rem; }
.footer-links a:hover { color: var(--sage-dark); }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
    padding: .85rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    font-size: .9rem;
    font-weight: 500;
    border: 1.5px solid;
    display: flex; align-items: center; gap: .6rem;
}
.alert-success  { background: #edf7ee; border-color: var(--sage);        color: var(--sage-dark); }
.alert-error,
.alert-danger   { background: var(--blush-light); border-color: var(--blush);  color: #c0505a; }
.alert-info     { background: var(--sky-light);   border-color: var(--sky);    color: #3a7a9c; }
.alert-warning  { background: var(--peach-light); border-color: var(--peach);  color: #b07030; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .65rem 1.5rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: .88rem; font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer; border: 2px solid transparent;
    transition: all .22s; text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--sage);
    color: var(--white);
    border-color: var(--sage);
    box-shadow: 0 3px 12px rgba(138,172,142,.35);
}
.btn-primary:hover {
    background: var(--sage-dark);
    border-color: var(--sage-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(94,136,106,.4);
    color: var(--white);
}
.btn-outline {
    background: transparent;
    color: var(--sage-dark);
    border-color: var(--sage);
}
.btn-outline:hover {
    background: var(--sage-light);
    color: var(--sage-dark);
    transform: translateY(-1px);
}
.btn-blush {
    background: var(--blush);
    color: var(--white);
    border-color: var(--blush);
    box-shadow: 0 3px 12px rgba(242,184,192,.4);
}
.btn-blush:hover {
    background: var(--blush-dark);
    border-color: var(--blush-dark);
    transform: translateY(-1px);
    color: var(--white);
}
.btn-danger {
    background: #e8606a;
    color: var(--white);
    border-color: #e8606a;
}
.btn-danger:hover { background: #c94a54; border-color: #c94a54; color: var(--white); }
.btn-sm  { padding: .4rem 1rem; font-size: .8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ── FORM ELEMENTS ──────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
label {
    display: block;
    font-size: .78rem; font-weight: 700;
    margin-bottom: .4rem;
    color: var(--text-mid);
    letter-spacing: .06em; text-transform: uppercase;
}
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], select, textarea {
    width: 100%; padding: .7rem 1rem;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body); font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(138,172,142,.18);
}
.form-error { color: #c0505a; font-size: .8rem; margin-top: .3rem; }
.form-hint  { color: var(--text-muted); font-size: .8rem; margin-top: .3rem; }

/* ── CARD ────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

/* ── PRODUCT GRID ───────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: var(--white);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
    display: flex; flex-direction: column;
    position: relative;
}
.product-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blush), var(--sage-light), var(--peach));
    opacity: 0;
    transition: opacity .25s;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(180,120,100,.14);
}
.product-card:hover::before { opacity: 1; }

.product-card img,
.product-card .product-img-placeholder {
    width: 100%; aspect-ratio: 4/3; object-fit: cover;
    background: var(--cream-dark);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 3rem;
}
.product-card-body {
    padding: 1.25rem; flex: 1;
    display: flex; flex-direction: column; gap: .3rem;
}
.product-card-body h3 {
    font-size: 1.05rem; font-weight: 500;
    color: var(--text);
}
.product-card-body .price {
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 600;
    color: var(--sage-dark);
}
.product-card-body .stock-low { color: #b07030; font-size: .8rem; font-weight: 600; }
.product-card-body .stock-out { color: #c0505a; font-size: .8rem; font-weight: 600; }
.product-card-body .btn { margin-top: auto; padding-top: .5rem; }

/* ── PRODUCT DETAIL ─────────────────────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 3.5rem; align-items: start;
}
@media (max-width: 1024px) {
    .product-detail { grid-template-columns: 1fr; }
}
.product-detail img,
.product-detail .img-placeholder {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: var(--radius-lg);
    background: var(--cream-dark);
    box-shadow: var(--shadow-soft);
}
.product-detail-info .price {
    font-family: var(--font-display);
    font-size: 2.2rem; font-weight: 600;
    color: var(--sage-dark);
    margin-bottom: 1rem;
}
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; gap: 2rem; } }

/* ── CART TABLE ─────────────────────────────────────────── */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.cart-table th, .cart-table td {
    padding: 1rem .75rem; text-align: left;
    border-bottom: 1.5px solid var(--border-soft);
}
.cart-table th {
    color: var(--text-muted); font-size: .75rem;
    text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
    background: var(--cream);
}
.cart-table tr:hover td { background: rgba(253,232,236,.25); }
.cart-table input[type=number] { width: 72px; text-align: center; }

/* ── CHECKOUT ────────────────────────────────────────────── */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem; align-items: start;
}
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }

#stripe-card-element {
    padding: .75rem 1rem;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, box-shadow .2s;
}
#stripe-card-element.StripeElement--focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(138,172,142,.18);
}
#card-errors { color: #c0505a; font-size: .85rem; margin-top: .4rem; }

/* ── ORDER SUMMARY ──────────────────────────────────────── */
.order-summary {
    background: var(--white);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}
.order-summary h3 {
    font-family: var(--font-display);
    font-size: 1.1rem; font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1.5px solid var(--border-soft);
}
.summary-line {
    display: flex; justify-content: space-between;
    padding: .4rem 0; font-size: .9rem; color: var(--text-mid);
}
.summary-line.total {
    border-top: 1.5px solid var(--border);
    margin-top: .5rem; padding-top: .75rem;
    font-weight: 700; font-size: 1.15rem;
    color: var(--sage-dark);
    font-family: var(--font-display);
}

/* ── STATUS BADGES ──────────────────────────────────────── */
.status-badge {
    padding: .25rem .8rem;
    border-radius: var(--radius-pill);
    font-size: .75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
}
.status-pending        { background: var(--peach-light);  color: #9a6020; border: 1px solid var(--peach); }
.status-pending_paypal { background: var(--sky-light);    color: #2a6a9a; border: 1px solid var(--sky); }
.status-paid           { background: #edf7ee;             color: var(--sage-dark); border: 1px solid var(--sage-light); }
.status-shipped        { background: var(--sky-light);    color: #2a6a9a; border: 1px solid var(--sky); }
.status-cancelled      { background: var(--blush-light);  color: #a03040; border: 1px solid var(--blush); }
.status-failed         { background: var(--blush-light);  color: #a03040; border: 1px solid var(--blush); }
.status-refunded       { background: var(--lavender);     color: #5040a0; border: 1px solid #b0a0e0; }

/* ── ACCOUNT ────────────────────────────────────────────── */
.order-list { list-style: none; }
.order-list li {
    padding: 1rem 0; border-bottom: 1.5px solid var(--border-soft);
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: .5rem;
}

/* ── ADMIN TABLE ────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    padding: .9rem 1rem; text-align: left;
    border-bottom: 1.5px solid var(--border-soft); font-size: .9rem;
}
.admin-table th {
    color: var(--text-muted); font-size: .74rem;
    text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
    background: var(--cream);
}
.admin-table tr:hover td { background: rgba(253,232,236,.2); }

/* ── PAGINATION ─────────────────────────────────────────── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; }
.pagination a, .pagination span {
    padding: .45rem 1rem; border-radius: var(--radius-pill);
    border: 1.5px solid var(--border); font-size: .85rem; font-weight: 600;
}
.pagination a { color: var(--text-mid); background: var(--white); }
.pagination a:hover { border-color: var(--sage); color: var(--sage-dark); }
.pagination .current { background: var(--sage); color: var(--white); border-color: var(--sage); }

/* ── HERO ────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 5.5rem 1.5rem 5rem;
    position: relative; overflow: hidden;
}
.hero::before {
    content: '🌸 ✿ 🌼 ✿ 🌸 ✿ 🌼 ✿ 🌸 ✿ 🌼 ✿ 🌸 ✿ 🌼 ✿ 🌸';
    position: absolute; top: 0; left: 0; right: 0;
    text-align: center; font-size: 1.1rem; letter-spacing: .35rem;
    color: rgba(242,184,192,.55);
    white-space: nowrap; overflow: hidden;
    padding: .6rem;
    background: var(--blush-light);
    border-bottom: 1.5px solid var(--border-soft);
}
.hero-eyebrow {
    display: inline-block;
    background: var(--sage-light);
    color: var(--sage-dark);
    font-size: .8rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: .35rem 1.1rem; border-radius: var(--radius-pill);
    margin-bottom: 1.5rem;
    border: 1.5px solid var(--sage);
}
.hero h1 {
    margin-bottom: 1rem;
    font-style: italic;
    color: var(--text);
}
.hero h1 em { color: var(--sage-dark); font-style: italic; }
.hero p {
    color: var(--text-mid); max-width: 560px;
    margin: 0 auto 2rem; font-size: 1.1rem;
    line-height: 1.75;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── SECTION HEADING ────────────────────────────────────── */
.section-heading {
    text-align: center; margin-bottom: 2.5rem;
}
.section-heading h2 { font-style: italic; }
.section-heading p { color: var(--text-muted); margin-top: .4rem; }
.section-heading::after {
    content: '·  ·  ·';
    display: block;
    color: var(--blush);
    font-size: 1.2rem;
    margin-top: .75rem;
    letter-spacing: .4rem;
}

/* ── AUTH FORMS ─────────────────────────────────────────── */
.auth-box { max-width: 440px; margin: 3rem auto; }
.auth-box .card {
    border-top: 4px solid var(--blush);
}

/* ── PAGE TITLE ─────────────────────────────────────────── */
.page-title { margin-bottom: 2rem; }
.page-title h1 { margin-bottom: .4rem; font-style: italic; }
.page-title p  { color: var(--text-muted); }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 4rem 1rem;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; }

/* ── TRUST BADGES ───────────────────────────────────────── */
.secure-badges {
    display: flex; gap: 1rem; flex-wrap: wrap;
    font-size: .75rem; color: var(--text-muted); font-weight: 600;
}
.secure-badges span {
    display: flex; align-items: center; gap: .3rem;
}
.secure-badges span::before { content: '🔒'; }

/* ── MISC ────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 600px) {
    .two-col { grid-template-columns: 1fr; }
    .nav-links { gap: .75rem; }
    .nav-links a { font-size: .78rem; }
}

/* ── PAYMENT TABS (checkout) ────────────────────────────── */
.payment-tabs {
    display: flex; gap: .75rem;
    border-bottom: 1.5px solid var(--border-soft);
    padding-bottom: .75rem; margin-bottom: .25rem; flex-wrap: wrap;
}
.payment-tab {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem 1.2rem; border-radius: var(--radius-pill);
    border: 1.5px solid var(--border); background: var(--white);
    color: var(--text-muted); font-size: .88rem; font-weight: 700;
    cursor: pointer; transition: all .2s; font-family: var(--font-body);
}
.payment-tab:hover { border-color: var(--sage); color: var(--sage-dark); }
.payment-tab.active {
    border-color: var(--sage); background: var(--sage-light);
    color: var(--sage-dark);
}

/* ── STAT CARDS (admin) ─────────────────────────────────── */
.stat-card {
    background: var(--white);
    border: 1.5px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-card);
    position: relative; overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--blush-light), var(--sage-light), var(--peach-light));
}
.stat-label {
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-muted); margin-bottom: .4rem;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 2.1rem; font-weight: 600;
    color: var(--text);
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes bloom {
    0%   { transform: scale(.92) rotate(-2deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.product-card {
    animation: fadeUp .4s ease both;
}
.product-card:nth-child(2) { animation-delay: .05s; }
.product-card:nth-child(3) { animation-delay: .10s; }
.product-card:nth-child(4) { animation-delay: .15s; }
.product-card:nth-child(5) { animation-delay: .20s; }
.product-card:nth-child(6) { animation-delay: .25s; }
.product-card:nth-child(7) { animation-delay: .30s; }
.product-card:nth-child(8) { animation-delay: .35s; }

.hero h1   { animation: fadeUp .5s .1s ease both; }
.hero p    { animation: fadeUp .5s .22s ease both; }
.hero-cta  { animation: fadeUp .5s .34s ease both; }
.hero-eyebrow { animation: bloom .5s .05s ease both; }

/* ── CATEGORY PILLS ─────────────────────────────────────── */
.category-pill {
    display: inline-block;
    padding: .3rem .85rem; border-radius: var(--radius-pill);
    font-size: .75rem; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase;
    background: var(--sage-light); color: var(--sage-dark);
    border: 1px solid var(--sage);
}

/* ── FEATURE STRIP ──────────────────────────────────────── */
.feature-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
    padding: 2rem;
    background: var(--cream-dark);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-soft);
}
.feature-item {
    text-align: center;
}
.feature-item .icon { font-size: 2rem; margin-bottom: .5rem; }
.feature-item strong { display: block; font-size: .9rem; color: var(--text); margin-bottom: .25rem; }
.feature-item span { font-size: .82rem; color: var(--text-muted); }