/* ═══════════════════════════════════════════════
   Clean.EARTH — Core Stylesheet v3.2
   Light theme · Green accent · 1400px max
   System fonts only · No external dependencies
   ═══════════════════════════════════════════════ */

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

:root {
    --bg: #f5f0eb;
    --white: #ffffff;
    --text: #1a1a1a;
    --text-muted: #6b6b6b;
    --text-light: #999;
    --accent: #2D6A4F;
    --accent-light: #40916C;
    --accent-bg: #d8f3dc;
    --border: #e0dcd7;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --radius: 12px;
    --max-w: 1400px;
    --content-w: 92%;
    --header-h: 56px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --grad: linear-gradient(90deg, #2D6A4F, #C9A84C, #3B82F6, #F97316, #2D6A4F);
}

/* ─── Animated Gradient Underline Keyframe ─── */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.gradient-line {
    height: 3px;
    background: var(--grad);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    border-radius: 2px;
}
/* Gradient text */
.gradient-text {
    background: var(--grad);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html { font-size: 15px; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
#content { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ─── HEADER ─── */
#header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-top: 3px solid transparent;
    border-bottom: 2px solid var(--accent);
    border-image: var(--grad) 1;
    border-image-slice: 1;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
#header-inner {
    max-width: var(--max-w);
    width: var(--content-w);
    margin: 0 auto;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#logo-link {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}
#site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}
#site-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 4px 0;
    position: relative;
}
#site-nav a:hover { color: var(--text); }
#site-nav a.active { color: var(--text); }
/* Active nav: animated gradient underline */
#site-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0; right: 0;
    height: 3px;
    background: var(--grad);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    border-radius: 2px;
}
#user-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}
#user-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: color 0.2s, background 0.2s, border-color 0.3s;
    border: 2px solid transparent;
    position: relative;
}
#user-nav a:hover {
    color: var(--accent);
    background: var(--accent-bg);
}
/* Icon-nav active: gradient border with rounded corners */
#user-nav a.icon-active {
    color: var(--accent);
    border: none;
    background: var(--grad);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    padding: 2px;
    border-radius: 10px;
}
#user-nav a.icon-active::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--white);
    border-radius: 8px;
    z-index: 0;
}
#user-nav a.icon-active svg { position: relative; z-index: 1; }
#user-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#cart-count {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.icon-btn { position: relative; }

/* ─── PAGE TITLE BLOCK (30% width, icon + title + desc) ─── */
.page-title-block {
    width: 30%;
    min-width: 280px;
    background: var(--white);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    animation: titleSlideIn .5s cubic-bezier(.4,0,.2,1) both;
}
@keyframes titleSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-title-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.page-title-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.page-title-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.page-title-text p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}
/* Legacy page-label kept for backward compat */
.page-label {
    display: none;
}

/* ─── CONTENT — vertically + horizontally centered ─── */
#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 32px 0 48px;
}
/* Flex spacers center content when short, collapse when content overflows */
#content::before,
#content::after {
    content: '';
    flex: 1 1 0px;
}
#content > * {
    width: var(--content-w);
    max-width: var(--max-w);
}

/* ─── FOOTER — matches header height ─── */
#footer {
    background: var(--white);
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-image: var(--grad) 1;
    border-image-slice: 1;
    margin-top: auto;
}
#footer-inner {
    max-width: var(--max-w);
    width: var(--content-w);
    margin: 0 auto;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}
#footer a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.25s, transform 0.2s;
}
#footer a:hover { color: var(--accent); transform: translateY(-1px); }
#footer svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ─── CART DRAWER ─── */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.5s ease; backdrop-filter: blur(2px); }
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-drawer {
    position: fixed; top: 0; right: -400px; width: 400px; height: 100vh;
    background: var(--white); z-index: 201;
    box-shadow: -6px 0 30px rgba(0,0,0,0.12);
    transition: right 1.5s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex; flex-direction: column;
    border-left: 3px solid var(--accent);
}
.cart-drawer.open { right: 0; }
.cart-head { padding: 18px 24px; border-bottom: 2px solid var(--accent); display: flex; justify-content: space-between; align-items: center; }
.cart-title { font-weight: 700; font-size: 1.1rem; color: var(--text); letter-spacing: 0.3px; }
.cart-close { font-size: 1.6rem; cursor: pointer; color: var(--text-muted); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: all 0.2s; }
.cart-close:hover { background: #fde8e8; color: #c00; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px 24px; }
.cart-items:empty::before { content: 'Your cart is empty'; display: block; text-align: center; color: var(--text-muted); padding: 60px 0; font-size: 0.9rem; }
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item-img { width: 56px; height: 56px; border-radius: 8px; background: var(--bg); object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; font-size: 0.9rem; }
.cart-item-price { color: var(--accent); font-weight: 600; font-size: 0.85rem; margin-top: 2px; }
.cart-item-qty { font-size: 0.8rem; color: var(--text-muted); }
.cart-item-remove { color: var(--text-muted); cursor: pointer; font-size: 1rem; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; transition: all 0.2s; }
.cart-item-remove:hover { color: #c00; background: #fde8e8; }
.cart-foot { padding: 18px 24px; border-top: 2px solid var(--accent); }
.cart-total-row { display: flex; justify-content: space-between; margin-bottom: 14px; font-weight: 600; font-size: 1rem; }
.btn-checkout { display: block; width: 100%; padding: 13px; background: var(--accent); color: #fff; text-align: center; border-radius: 8px; font-weight: 600; font-size: 0.95rem; transition: background 0.2s; cursor: pointer; }
.btn-checkout:hover { background: var(--accent-light); }

/* ─── PRODUCT CARDS ─── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--border); }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.product-card-img { width: 100%; aspect-ratio: 1; background: var(--bg); object-fit: cover; }
.product-card-body { padding: 16px; }
/* Product name = gradient text */
.product-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 8px;
    background: var(--grad);
    background-size: 200% 100%;
    animation: gradientShift 3s linear infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Product price with gradient underline */
.product-card-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    display: inline-block;
    position: relative;
    padding-bottom: 4px;
}
/* ::after underline removed — home.css uses .product-card-price-line instead */
.product-card-price .sale { color: var(--text-muted); text-decoration: line-through; font-size: 0.85rem; margin-left: 6px; font-weight: 400; }
.product-card-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 8px; line-height: 1.4; }
.btn-add-cart { display: block; width: 100%; margin-top: 12px; padding: 10px; background: var(--accent); color: #fff; text-align: center; border-radius: 8px; font-weight: 600; font-size: 0.9rem; transition: background 0.2s; cursor: pointer; border: none; }
.btn-add-cart:hover { background: var(--accent-light); }

/* ─── SECTION CARDS ─── */
.section-card { background: var(--white); padding: 28px; border: 2px solid var(--accent); border-radius: var(--radius); }
.section-title { font-weight: 700; font-size: 1.25rem; color: var(--accent); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.8; }

/* ─── FAQ — page-specific styles now in pages/faq.css ─── */

/* ─── SHARED BUTTONS ─── */
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; font-size: 0.9rem; transition: background 0.2s; border: none; cursor: pointer; }
.btn-primary:hover { background: var(--accent-light); }
.btn-primary svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-weight: 600; font-size: 0.9rem; transition: all 0.2s; cursor: pointer; background: var(--white); letter-spacing: 0.5px; text-transform: uppercase; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ─── REVIEWS — page-specific styles now in pages/reviews.css ─── */

/* ─── TRACKING — page-specific styles now in pages/tracking.css ─── */

/* ─── FORMS ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 0; font-size: 0.9rem; font-family: var(--font); outline: none; transition: border 0.2s; background: var(--white); border-bottom: none; }
.form-input:last-of-type { border-bottom: 1px solid var(--border); }
.form-input:focus { border-color: var(--accent); position: relative; z-index: 1; }
textarea.form-input { resize: vertical; min-height: 100px; border-radius: 8px; border: 1px solid var(--border); }

/* ─── ACCOUNT — page-specific styles now in pages/account.css ─── */
/* Shared elements used by account + other pages remain here */
.section-label { font-weight: 600; font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.order-history { display: flex; flex-direction: column; gap: 8px; }
.order-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border-radius: 8px; font-size: 0.9rem; }
.order-ref { font-weight: 600; }
.order-amount { font-weight: 600; color: var(--accent); }
.order-status { font-size: 0.8rem; padding: 3px 10px; border-radius: 12px; font-weight: 500; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid { background: #d1fae5; color: #065f46; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-packed { background: #e0e7ff; color: #3730a3; }
.status-shipped { background: #cffafe; color: #155e75; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fde8e8; color: #9b1c1c; }
.status-refunded { background: #fde8e8; color: #9b1c1c; }
.order-date { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }
.order-track { font-size: 0.8rem; font-weight: 600; color: var(--accent); }
.empty-state { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 0.9rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    :root { --content-w: 94%; }
    #site-nav { display: none; }
    .page-title-block { width: 100% !important; min-width: unset !important; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    #content { padding: 20px 0 32px; }
    .cart-drawer { width: 320px; right: -320px; }
}
@media (max-width: 480px) {
    :root { --content-w: 96%; }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .cart-drawer { width: 280px; right: -280px; }
    .cart-head { padding: 14px 16px; }
    .cart-items { padding: 14px 16px; }
    .cart-foot { padding: 14px 16px; }
}
