/* ============================================================
   TATLI DANE (تاتلی دانه) — Design System
   Persian online store for traditional sweets & herbal products
   RTL | Vazirmatn | Cream/Ivory | Green | Gold | Brown
============================================================ */

/* ---------- Theme tokens (light / dark) ---------- */
:root {
  --td-bg: #ffffff;
  --td-bg-page: #fdfaf5;
  --td-bg-card: #ffffff;
  --td-bg-soft: #f7f3ec;
  --td-text: #2d221d;
  --td-text-body: #3d342e;
  --td-text-muted: #7a6f66;
  --td-border: #e7dccf;
  --td-border-light: #d4c6b0;
  --td-primary: #15803D;
  --td-primary-hover: #0f5f2e;
  --td-input-bg: #ffffff;
  --td-input-border: #d4c6b0;
  --td-shadow: 0 12px 24px -6px rgba(21,128,61,0.12);
  --td-shadow-soft: rgba(0,0,0,0.04);
}

html.dark-mode {
  --td-bg: #14100d;
  --td-bg-page: #0e0c0a;
  --td-bg-card: #1d1814;
  --td-bg-soft: #231c18;
  --td-text: #f3e8d4;
  --td-text-body: #e3d0b8;
  --td-text-muted: #b9ae9e;
  --td-border: #3d2e24;
  --td-border-light: #4a3a2e;
  --td-primary: #5cc98a;
  --td-primary-hover: #6ee7b7;
  --td-input-bg: #1d1814;
  --td-input-border: #4a3a2e;
  --td-shadow: 0 12px 24px -6px rgba(0,0,0,0.5);
  --td-shadow-soft: rgba(0,0,0,0.25);
}

/* ---------- Reset & base ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    background: var(--td-bg-page);
    color: var(--td-text-body);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
input, button, select, textarea {
    font-family: inherit;
    font-size: inherit;
}
button {
    background: none;
    border: none;
    cursor: pointer;
}

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

.section-padding { padding: 70px 0; }
.section-header { margin-bottom: 40px; text-align: center; }
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d221d;
    margin-bottom: 10px;
    letter-spacing: -0.4px;
}
.section-subtitle {
    color: #7a6f66;
    font-size: 1rem;
}

/* ---------- Reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Header ---------- */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e7dccf;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-main {
    flex: 1;
}

.header-top {
    background: #f3e8d4;
    font-size: 0.85rem;
    color: #5c4a3e;
    padding: 6px 0;
}
.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.top-text { display: flex; align-items: center; gap: 6px; }
.top-text i { color: #b45309; }
.top-links { display: flex; gap: 12px; align-items: center; }
.top-link {
    font-size: 0.85rem;
    color: #5c4a3e;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}
.top-link:hover { background: #e3d0b8; }
.top-link.btn-outline-sm {
    border: 1px solid #b45309;
    color: #b45309;
    font-weight: 600;
    padding: 4px 12px;
}

.header-main {
    padding: 16px 0;
}
.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #15803D;
    white-space: nowrap;
}
.logo i { font-size: 1.75rem; color: #b45309; }

.main-nav .nav-list {
    display: flex;
    gap: 6px;
    align-items: center;
}
.main-nav a {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3d342e;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}
.main-nav a:hover, .main-nav a.active {
    color: #15803D;
    background: #f0f7ee;
}
.main-nav a.active { color: #15803D; font-weight: 600; }

/* دسته‌بندی در ناوبر (DropDown) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3d342e;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}
.nav-dropdown-toggle:hover { color: #15803D; background: #f0f7ee; }
.nav-dropdown-toggle i { font-size: 0.7rem; transition: transform 0.25s ease; }
.nav-dropdown:hover .nav-dropdown-toggle i,
.nav-dropdown.open .nav-dropdown-toggle i { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.10);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.94) translateY(-10px);
    transform-origin: top right;
    transition: opacity 0.22s ease, transform 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 60;
    padding: 8px 0;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}
.nav-dropdown-menu li { list-style: none; }
.nav-dropdown-menu a {
    display: block;
    padding: 9px 16px;
    font-size: 0.9rem;
    color: #3d342e;
    border-radius: 0;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, padding-right 0.15s;
}
.nav-dropdown-menu a:hover {
    background: #f0f7ee;
    color: #15803D;
    padding-right: 20px;
}

/* ستاره امتیازدهی نظر */
.star-rating .star { cursor: pointer; color: #ccc; font-size: 1.5rem; user-select: none; }
.star-rating .star.selected { color: #d4a373; }


.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3d342e;
    position: relative;
    transition: background 0.2s, color 0.2s;
    border: 1px solid transparent;
}
.icon-btn:hover { background: #f0f7ee; color: #15803D; }
.icon-btn i { font-size: 1.1rem; }
.cart-count {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: #b45309;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    color: #3d342e;
    border: 1px solid #e7dccf;
    background: #fff;
    z-index: 201;
}
.mobile-menu-btn:hover { background: #f0f7ee; border-color: #15803D; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: linear-gradient(135deg, #fdfaf5 0%, #f3e8d4 100%);
    border-radius: 30px;
    padding: 70px 24px;
    overflow: hidden;
    margin: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}
.hero-content { flex: 1; text-align: right; }
.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    color: #2d221d;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: #7a6f66;
    margin-bottom: 24px;
    line-height: 1.7;
    max-width: 480px;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-image { flex: 1; position: relative; }
.hero-img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(21,128,61,0.18);
    object-fit: cover;
}
.candy-decoration {
    position: absolute;
    top: -40px; left: -40px;
    width: 140px; height: 140px;
    background: #D4A373;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.5;
    z-index: 0;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}
.btn-primary {
    background: var(--td-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--td-primary-hover); transform: translateY(-1px); box-shadow: 0 8px 16px -6px rgba(21,128,61,0.35); }
.btn-outline {
    background: transparent;
    color: var(--td-primary);
    border: 2px solid var(--td-primary);
}
.btn-outline:hover { background: var(--td-primary); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-large { padding: 16px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Section headers with button ---------- */
.section-header.with-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---------- Category grid ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.category-card {
    background: var(--td-bg-card);
    border: 1px solid var(--td-border);
    border-radius: 18px;
    padding: 16px;
    text-align: center;
    transition: all 0.25s, background 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 250px;
}
.category-card:hover {
    border-color: var(--td-primary);
    transform: translateY(-4px);
    box-shadow: var(--td-shadow);
}
.category-card:focus-visible {
    outline: 2px solid var(--td-primary);
    outline-offset: 3px;
}
.category-image {
    width: 100%;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--td-bg-soft);
    border: 1px solid var(--td-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.category-icon-fallback {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #f0f7ee;
    color: #15803D;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.category-name {
    font-weight: 700;
    color: var(--td-text);
    font-size: 1.05rem;
    margin: 0;
}

/* ---------- Product grid & card ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 24px;
}
.product-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    position: isolate;
}
.product-card.revealed {
    opacity: 1;
    transform: none;
}
.product-card:hover {
    border-color: #b45309;
    transform: translateY(-6px);
    box-shadow: 0 16px 32px -8px rgba(0,0,0,0.08);
}
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #b45309;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.product-image {
    position: relative;
    height: 230px;
    overflow: hidden;
    background: #f3e8d4;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-image img { transform: scale(1.05); }
.product-placeholder {
    width: 60px; height: 60px;
    border-radius: 14px;
    background: #e7dccf;
    color: #b45309;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.product-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 2;
}
.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}
.icon-action {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    color: #3d342e;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border: 1px solid #e7dccf;
}
.icon-action:hover { background: #15803D; color: #fff; border-color: #15803D; }

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.product-category {
    font-size: 0.78rem;
    font-weight: 600;
    color: #15803D;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.product-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d221d;
    line-height: 1.3;
    margin-bottom: 4px;
}
.product-brand {
    font-size: 0.85rem;
    color: #7a6f66;
}
.product-price {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #15803D;
}
.old-price {
    font-size: 0.9rem;
    color: #9a8a7c;
    text-decoration: line-through;
}

.empty-msg, .empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #7a6f66;
}
.empty-state i { font-size: 2.5rem; margin-bottom: 12px; color: #c9b8a3; }
.empty-state h3 { color: #3d342e; margin-bottom: 8px; font-size: 1.2rem; }

/* ---------- CTA section ---------- */
.cta-section {
    background: linear-gradient(135deg, #15803D 0%, #0f5f2e 100%);
    border-radius: 26px;
    color: #fff;
    text-align: center;
    padding: 56px 24px;
    margin-top: 10px;
}
.cta-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 10px; }
.cta-text { color: #d8ead4; font-size: 1.05rem; margin-bottom: 24px; }

/* ---------- Testimonials ---------- */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.testimonial-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 18px;
    padding: 26px;
}
.stars { color: #D4A373; font-size: 1.1rem; margin-bottom: 10px; }
.testimonial-card p { color: #5c4a3e; font-size: 0.95rem; line-height: 1.6; margin-bottom: 14px; }
.testimonial-author { font-weight: 700; color: #2d221d; font-size: 0.9rem; }

/* ---------- Newsletter ---------- */
.newsletter {
    background: #f0f7ee;
    border: 1px dashed #15803D;
    border-radius: 22px;
    padding: 40px 24px;
    text-align: center;
}
.newsletter h3 { font-size: 1.4rem; color: #2d221d; margin-bottom: 8px; }
.newsletter p { color: #7a6f66; margin-bottom: 20px; }
.newsletter form {
    display: flex;
    gap: 10px;
    max-width: 460px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.newsletter input[type="email"] {
    flex: 1;
    min-width: 220px;
    padding: 12px 16px;
    border: 1px solid #d4c6b0;
    border-radius: 12px;
    background: #fff;
}
.newsletter input[type="email"]:focus { outline: none; border-color: #15803D; }

/* ---------- Footer ---------- */
.site-footer {
    background: #2d221d;
    color: #e8dfd1;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding: 60px 0 30px;
}
.footer-title {
    color: #f3e8d4;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 18px;
}
.footer-text { color: #b9ae9e; font-size: 0.92rem; line-height: 1.7; margin-bottom: 16px; }
.social-links { display: flex; gap: 12px; }
.social-links a {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #3d342e;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s;
}
.social-links a:hover { background: #15803D; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #b9ae9e; font-size: 0.92rem; transition: color 0.2s; }
.footer-links a:hover { color: #D4A373; }
.contact-list li { color: #b9ae9e; font-size: 0.92rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.contact-list li i { color: #b45309; width: 16px; }
.footer-bottom {
    border-top: 1px solid #3d342e;
    padding: 24px 0;
    text-align: center;
    color: #8e8275;
    font-size: 0.85rem;
}

/* ---------- Messages / alerts ---------- */
.messages-container { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 10px; width: 92%; max-width: 520px; }
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.92rem;
    animation: slideDown 0.35s ease;
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid transparent;
}
@keyframes slideDown { from { transform: translateX(-50%) translateY(-20px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
.alert-success { background: #dcfce7; color: #166534; border-color: #86efac; }
.alert-error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.close-btn { background: none; border: none; font-size: 1.4rem; color: inherit; opacity: 0.7; cursor: pointer; line-height: 1; }
.close-btn:hover { opacity: 1; }

/* ---------- Form-level errors shown in the upper layer of auth forms ---------- */
.form-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 18px;
    text-align: right;
    animation: slideInDown 0.35s ease;
}
@keyframes slideInDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #7a6f66;
    margin-bottom: 24px;
}

/* ---------- Product detail gallery (modern, RTL) ---------- */
 /* Theme tokens used by the detail page site uses --td-*; these are the --dk-*//*--primary tokens the pasted style needs */
:root {
  --dk-white: #ffffff;
  --dk-border: #e2e6e8;
  --dk-dark: #1f2937;
  --dk-gray: #6b7280;
  --dk-green: #0d9488;
  --primary: #0d9488;
  --primary-light: rgba(13, 148, 136, 0.12);
  --primary-hover: #0f766e;
  --shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 20px 32px -6px rgba(0, 0, 0, 0.12);
}
html.dark-mode {
  --dk-white: #1d1814;
  --dk-border: #3d2e24;
  --dk-dark: #f3e8d4;
  --dk-gray: #b9ae9e;
  --dk-green: #5cc98a;
  --primary: #5cc98a;
  --primary-light: rgba(92, 201, 138, 0.15);
  --primary-hover: #6ee7b7;
  --shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 20px 32px -6px rgba(0, 0, 0, 0.6);
}

.detail-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  min-height: calc(100vh - 280px);
}

.detail-page .breadcrumb {
  max-width: none;
  margin: 0 0 26px;
  padding: 0;
  font-size: 13px;
}

.detail-card {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 0;
  background: var(--dk-white);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--dk-border);
  overflow: hidden;
}

/* ---------- Gallery ---------- */
.detail-gallery {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  position: relative;
  background: #fbfcfd;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.gallery-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dk-dark);
  margin: 0;
  letter-spacing: 0.2px;
}

.gallery-count {
  font-size: 12px;
  color: var(--dk-gray);
  font-weight: 500;
  background: var(--dk-white);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--dk-border);
}

.gallery-main-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-main {
  position: relative;
  aspect-ratio: 1;
  background: #f2f4f6;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--dk-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
  max-height: 500px;
}

.gallery-main:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
  background: #f0f2f4;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-main:hover img {
  transform: scale(1.04);
}

.gallery-zoom-btn {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s, background 0.2s, color 0.2s;
  z-index: 4;
  opacity: 0;
  transform: translateY(12px);
}

.gallery-main:hover .gallery-zoom-btn {
  opacity: 1;
  transform: translateY(0);
}

.gallery-zoom-btn:hover {
  background: var(--dk-white);
  color: var(--primary);
  transform: translateY(-1px);
}

.product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef1f3;
  color: var(--dk-gray);
  font-size: 14px;
  border-radius: 18px;
}

/* ---------- Thumbnails ---------- */
.gallery-thumbnails-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.thumb-nav {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--dk-border);
  background: var(--dk-white);
  color: var(--dk-dark);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 5;
  flex-shrink: 0;
}

.thumb-nav:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.thumb-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--dk-border) transparent;
  flex: 1;
  -ms-overflow-style: none;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: var(--dk-border);
  border-radius: 3px;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #f2f4f6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-thumb:hover {
  border-color: var(--primary-light);
  transform: translateY(-3px);
}

.gallery-thumb:hover img {
  opacity: 0.85;
}

.gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.gallery-thumb.active img {
  opacity: 1;
}

.gallery-thumb:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Info ---------- */
.detail-info {
  padding: 32px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-brand {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 5px 14px;
  border-radius: 24px;
  width: fit-content;
}

.detail-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--dk-dark);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.3px;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 9px;
}

.product-rating .stars {
  color: #f9bc00;
  font-size: 20px;
  letter-spacing: -1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.product-rating span {
  font-size: 14px;
  color: var(--dk-gray);
  font-weight: 600;
}

.detail-price {
  font-size: 27px;
  font-weight: 800;
  color: var(--dk-dark);
  margin-top: 2px;
}

.detail-price span {
  font-size: 14px;
  font-weight: 500;
  color: var(--dk-gray);
  margin-left: 7px;
}

.detail-facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.detail-facts li {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 14px 18px;
  font-size: 14px;
  color: var(--dk-dark);
  padding: 9px 0;
  border-bottom: 1px solid #f2f3f5;
  align-items: baseline;
}

.detail-facts li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-facts li span {
  color: var(--dk-gray);
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
  text-transform: capitalize;
}

.detail-facts li b {
  font-weight: 700;
  color: var(--dk-dark);
}

.stock-ok { color: var(--dk-green); font-weight: 800; }
.stock-low { color: #ef4056; font-weight: 800; }

/* ---------- Buy section ---------- */
.detail-buy {
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid #f2f3f5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-buy form {
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-buy input[type="number"] {
  width: 100px;
  height: 48px;
  border: 1.5px solid var(--dk-border);
  border-radius: 13px;
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--dk-dark);
  background: #f7f8fa;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.detail-buy input[type="number"]:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.add-to-cart-btn {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s;
}

.add-to-cart-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(13, 148, 136, 0.36);
  filter: brightness(1.05);
}

.add-to-cart-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.25);
}

.add-to-cart-btn:disabled {
  background: #e0e0e2;
  color: #81858b;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

/* ---------- Specifications ---------- */
.detail-specifications {
  margin-top: 0;
  border-top: 1px solid #f2f3f5;
  padding-top: 26px;
}

.detail-specifications h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--dk-dark);
  margin: 0 0 8px;
}

.specifications-subtitle {
  font-size: 14px;
  color: var(--dk-gray);
  margin-bottom: 18px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 30, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease, display 0.3s ease;
  overflow: auto;
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(1.08);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.2s;
  z-index: 3;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: 26px; }
.lightbox-next { right: 26px; }

.lightbox-thumbnails {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 11px;
  z-index: 3;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 56px;
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.lightbox-thumb {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-thumb.active,
.lightbox-thumb:hover {
  opacity: 1;
  border-color: var(--primary-hover);
  transform: scale(1.08);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .detail-card {
    grid-template-columns: 1fr;
  }

  .detail-gallery {
    padding: 22px;
  }

  .gallery-main {
    max-height: 420px;
  }

  .detail-info {
    padding: 26px 24px;
  }

  .detail-title {
    font-size: 24px;
  }

  .detail-price {
    font-size: 23px;
  }
}

@media (max-width: 480px) {
  .detail-page {
    padding: 14px 12px 40px;
  }

  .detail-card {
    border-radius: 16px;
  }

  .detail-gallery {
    padding: 18px;
    gap: 10px;
  }

  .gallery-title {
    font-size: 14px;
  }

  .gallery-main {
    max-height: 300px;
    border-radius: 14px;
  }

  .gallery-thumb {
    width: 66px;
    height: 66px;
  }

  .detail-info {
    padding: 24px 20px;
    gap: 14px;
  }

  .detail-title {
    font-size: 21px;
  }

  .detail-price {
    font-size: 20px;
  }

  .detail-buy form {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-buy input[type="number"] {
    width: 100%;
  }

  .lightbox {
    padding: 24px 16px;
  }

  .lightbox-image {
    max-height: 75vh;
  }

  .lightbox-thumbnails {
    bottom: 22px;
    gap: 8px;
    padding: 10px 14px;
  }

  .lightbox-thumb {
    width: 38px;
    height: 38px;
  }
}


.product-header {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.small {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f0f7ee;
    color: #15803D;
}
.product-title { font-size: 1.75rem; font-weight: 800; color: #2d221d; line-height: 1.3; margin-bottom: 10px; letter-spacing: -0.5px; }
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.rating-text { font-size: 0.85rem; color: #7a6f66; }
.product-price-detail {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}
.current-price { font-size: 1.5rem; font-weight: 800; color: #15803D; }
.old-price { font-size: 1.1rem; color: #9a8a7c; text-decoration: line-through; }
.stock-status {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    width: fit-content;
}
.stock-status.in-stock { background: #dcfce7; color: #166534; }
.stock-status.out-of-stock { background: #fee2e2; color: #991b1b; }
.product-short-desc {
    color: #5c4a3e;
    line-height: 1.7;
    margin-bottom: 20px;
}
.qty-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.qty-selector label { font-weight: 600; color: #3d342e; font-size: 0.9rem; white-space: nowrap; }
.qty-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: #f3e8d4;
    color: #15803D;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #d4c6b0;
}
.qty-btn:hover { background: #15803D; color: #fff; }
.qty-input {
    width: 52px;
    padding: 8px;
    border: 1px solid #d4c6b0;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.product-meta { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e7dccf; }
.product-meta p { font-size: 0.88rem; color: #7a6f66; margin-bottom: 6px; }
.product-meta p strong { color: #3d342e; }

.product-description { margin-top: 10px; }
.product-description h3 { font-size: 1.25rem; color: #2d221d; margin-bottom: 12px; }
.product-description p { color: #5c4a3e; line-height: 1.75; white-space: pre-line; }

.related-products h3 { font-size: 1.25rem; color: #2d221d; margin-bottom: 16px; }

/* ---------- Product list page ---------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 26px;
    align-items: center;
}
.filter-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #3d342e;
    align-self: center;
}
.filter-btn {
    padding: 8px 16px;
    border: 1px solid #d4c6b0;
    border-radius: 30px;
    background: #fff;
    color: #3d342e;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: #15803D; color: #15803D; }
.filter-btn.active { background: #15803D; color: #fff; border-color: #15803D; }
.sort-select {
    margin-left: auto;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d4c6b0;
    background: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    color: #3d342e;
}

/* ---------- Forms ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.form-group {
    display: flex; flex-direction: column; gap: 6px;
}
.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #3d342e;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 14px;
    border: 1px solid #d4c6b0;
    border-radius: 10px;
    background: #fff;
    color: #3d342e;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #15803D;
    box-shadow: 0 0 0 3px rgba(21,128,61,0.1);
}
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #3d342e;
    margin-bottom: 4px;
}
.auth-links { margin-top: 18px; text-align: center; }
.auth-links a { color: #15803D; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }

/* ---------- Cart page ---------- */
.cart-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid #e7dccf; margin-bottom: 24px; }
.cart-table th {
    text-align: right;
    padding: 16px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #7a6f66;
    background: #f7f4ee;
    border-bottom: 1px solid #e7dccf;
}
.cart-table td {
    padding: 18px 20px;
    font-size: 0.92rem;
    color: #3d342e;
    border-bottom: 1px solid #eef0ec;
    vertical-align: middle;
}
.cart-table tr:last-child td { border-bottom: none; }
.cart-item-img {
    width: 72px; height: 72px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e7dccf;
}
.cart-item-row { display: flex; align-items: center; gap: 12px; }
.cart-item-name { font-weight: 700; color: #2d221d; }
.cart-item-brand { font-size: 0.82rem; color: #7a6f66; display: block; margin-top: 2px; }
.cart-qty-form { display: flex; align-items: center; gap: 8px; }
.cart-qty-form input[type="number"] {
    width: 52px; padding: 6px 8px; text-align: center;
    border: 1px solid #d4c6b0; border-radius: 8px;
}
.btn-ghost {
    padding: 6px 12px;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #fecaca;
}
.btn-ghost:hover { background: #fee2e2; }

.cart-summary {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 16px;
    padding: 26px;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.95rem;
    color: #3d342e;
    border-bottom: 1px solid #f0efe8;
}
.cart-summary-row:last-child { border-bottom: none; }
.cart-summary-row.total {
    font-size: 1.15rem;
    font-weight: 800;
    color: #15803D;
    border-top: 2px solid #e7dccf;
    padding-top: 14px;
    margin-top: 8px;
}
.empty-cart {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 20px;
    padding: 60px 24px;
    text-align: center;
}
.empty-cart i { font-size: 3rem; color: #c9b8a3; margin-bottom: 16px; }
.empty-cart h2 { color: #2d221d; margin-bottom: 8px; }
.empty-cart p { color: #7a6f66; margin-bottom: 24px; }

/* ---------- Checkout ---------- */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}
.order-form {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 18px;
    padding: 30px;
}
.order-form h2 { font-size: 1.4rem; color: #2d221d; margin-bottom: 24px; }
.order-summary-card {
    background: #f0f7ee;
    border: 1px dashed #15803D;
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 20px;
}
.order-summary-card h3 { font-size: 1.2rem; color: #2d221d; margin-bottom: 16px; border-bottom: 1px solid #d4c6b0; padding-bottom: 10px; }
.payment-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.payment-option {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border: 1px solid #d4c6b0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}
.payment-option input { width: 18px; height: 18px; accent-color: #15803D; }
.payment-option span { font-size: 0.92rem; color: #3d342e; }
.payment-option:hover { border-color: #15803D; background: #f0f7ee; }
.payment-option input:checked + span { font-weight: 700; color: #15803D; }

/* ---------- Order success / tracking ---------- */
.order-success {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 20px;
    padding: 40px 24px;
}
.order-success i { font-size: 3rem; color: #15803D; margin-bottom: 16px; }
.order-success h1 { color: #2d221d; margin-bottom: 8px; }
.order-success p { color: #7a6f66; margin-bottom: 24px; }
.order-meta {
    background: #f7f4ee;
    border-radius: 14px;
    padding: 20px;
    text-align: right;
    margin-bottom: 24px;
}
.order-meta p { margin: 6px 0; font-size: 0.95rem; }
.order-meta p strong { color: #2d221d; }

.progress-tracker {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}
.progress-tracker::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    height: 4px;
    background: #d4c6b0;
    border-radius: 2px;
    z-index: 0;
}
.progress-step {
    text-align: center;
    z-index: 1;
    flex: 1;
}
.step-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid #d4c6b0;
    background: #fff;
    color: #7a6f66;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 6px;
    position: relative;
}
.progress-step.active .step-circle {
    border-color: #15803D;
    background: #15803D;
    color: #fff;
}
.progress-step.completed .step-circle {
    border-color: #15803D;
    background: #15803D;
    color: #fff;
}
.progress-step.completed .step-circle::after { content: '✓'; }
.progress-step .step-label { font-size: 0.82rem; color: #5c4a3e; font-weight: 600; }
.progress-step.active .step-label { color: #15803D; }

.order-detail-box {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 16px;
    padding: 24px;
}
.order-items-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.order-items-table th, .order-items-table td {
    text-align: right;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0ec;
    font-size: 0.9rem;
}
.order-items-table th { color: #7a6f66; font-weight: 600; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
}
.status-pending_payment { background: #fef3c7; color: #92400e; }
.status-paid { background: #dcfce7; color: #166534; }
.status-preparing { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ---------- Order detail ---------- */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
.order-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background: #f7f4ee;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}
.order-meta h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d221d;
    margin: 0 0 6px;
}
.order-number {
    color: #15803D;
    font-weight: 700;
}
.order-date {
    font-size: 0.9rem;
    color: #7a6f66;
}
.order-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.order-items-card,
.order-totals-card,
.order-info-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.order-items-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 16px;
    padding: 24px;
}
.order-totals-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 16px;
    padding: 24px;
}
.order-info-grid {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 16px;
    padding: 24px;
}
.order-items-card h3,
.order-totals-card h3,
.order-info-grid h3,
.order-review-card h3,
.info-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d221d;
    margin: 0 0 16px;
    border-bottom: 2px solid #e7dccf;
    padding-bottom: 8px;
}
.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.orders-table th,
.orders-table td {
    text-align: right;
    padding: 10px 12px;
    border-bottom: 1px solid #eef0ec;
    font-size: 0.9rem;
}
.orders-table th {
    color: #7a6f66;
    font-weight: 600;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}
.summary-row.total {
    font-weight: 700;
    color: #15803D;
    border-top: 1px solid #e7dccf;
    padding-top: 12px;
    margin-top: 8px;
}
.order-review-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 14px;
    padding: 20px;
    margin-top: 20px;
}
.order-progress {
    margin-top: 24px;
}

/* ---------- Contact page ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 34px;
    margin-top: 26px;
    align-items: start;
}
.contact-form-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 20px;
    padding: 30px;
}
.contact-form-title {
    font-size: 1.35rem;
    color: #2d221d;
    margin-bottom: 20px;
}
.contact-info-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 20px;
    padding: 26px;
}
.contact-info-title {
    font-size: 1.15rem;
    color: #2d221d;
    margin-bottom: 16px;
}
.contact-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    color: #5c4a3e;
}
.contact-list-icon {
    color: #b45309;
    margin-top: 4px;
}
.contact-social-links {
    display: flex;
    gap: 10px;
}
.contact-social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #3d342e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-email {
    color: #15803D;
}

/* ---------- Profile / dashboard ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card i { font-size: 1.6rem; color: #15803D; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 800; color: #2d221d; }
.stat-card .stat-label { font-size: 0.85rem; color: #7a6f66; }

.profile-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.profile-card-centered {
    max-width: 800px;
    margin: 0 auto;
}
.profile-card-centered .profile-grid-inner {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}
.profile-card-centered .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 36px 36px 24px;
}
.profile-card-centered .profile-avatar-circle {
    margin: 0 auto 20px;
}
.profile-card-centered .profile-main-info {
    margin-top: 16px;
}
.profile-header {
    padding: 36px 36px 24px;
    border-bottom: 1px solid #e7dccf;
    display: flex;
    gap: 24px;
    align-items: center;
}
.profile-avatar {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: #f0f7ee;
    color: #15803D;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.profile-main-info h2 { font-size: 1.75rem; color: #2d221d; margin-bottom: 6px; }
.profile-username { font-size: 1rem; color: #7a6f66; }
.profile-email { font-size: 0.95rem; color: #5c4a3e; margin-top: 4px; }

.profile-grid {
    padding: 30px 36px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.profile-item {
    background: #f7f4ee;
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.profile-item .label { font-size: 0.85rem; font-weight: 600; color: #000000; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.profile-item .value { font-size: 0.95rem; color: #000000; font-weight: 600; min-width: 0; overflow-wrap: break-word; }
.profile-grid-inner {
    padding: 30px 36px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.profile-actions {
    padding: 24px 36px 36px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.profile-actions .btn-primary { flex: 1; min-width: 150px; justify-content: center; }

/* ---------- Profile shell (menu + page content) ---------- */
.profile-shell {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.profile-menu {
    width: 250px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-top: 4px;
}
.menu-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2d221d;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef0ec;
    text-align: center;
}
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    color: #5c4a3e;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: right;
}
.menu-link i {
    font-size: 1.05rem;
    flex-shrink: 0;
}
.menu-link:hover {
    background: #f7f4ee;
    border-color: #e7dccf;
    color: #15803D;
}
.menu-link.active {
    background: #f0f7ee;
    border-color: #15803D;
    color: #15803D;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(21,128,61,0.08);
}
.profile-content {
    flex: 1;
    min-width: 0;
}

.order-history-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid #e7dccf; }
.order-history-table th {
    text-align: right;
    padding: 14px 16px;
    background: #f7f4ee;
    font-size: 0.85rem;
    font-weight: 600;
    color: #7a6f66;
    border-bottom: 1px solid #e7dccf;
}
.order-history-table td { padding: 14px 16px; font-size: 0.9rem; border-bottom: 1px solid #eef0ec; }
.order-history-table tr:last-child td { border-bottom: none; }

/* ---------- Auth pages ---------- */
.auth-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: #fff;
    border: 1px solid #e7dccf;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    float: none;
}
.auth-card.wide { max-width: 520px; }
.auth-card h1 { font-size: 1.7rem; color: #2d221d; margin-bottom: 6px; text-align: center; }
.auth-subtitle { text-align: center; color: #7a6f66; margin-bottom: 24px; font-size: 0.95rem; }
.auth-subtitle a { color: #15803D; font-weight: 600; }
.auth-card .form-group { margin-bottom: 14px; }
.auth-btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 10px;
}

/* ---------- Modern curved form inputs ---------- */
.modern-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    position: relative;
}
.modern-input label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #3d342e;
    margin-bottom: 0;
}
.modern-input .req { color: #b45309; }
.modern-input input,
.modern-input select,
.modern-input textarea {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e7dccf;
    border-radius: 16px;
    background: #fdfaf5;
    color: #3d342e;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.25s ease;
}
.modern-input input:focus,
.modern-input select:focus,
.modern-input textarea:focus {
    outline: none;
    border-color: #15803D;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(21,128,61,0.08);
}
.modern-input input.error,
.modern-input select.error,
.modern-input textarea.error {
    border-color: #dc2626;
    background: #fef2f2;
}
.modern-input input.error:focus,
.modern-input select.error:focus,
.modern-input textarea.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220,38,38,0.1);
}
.error-msg {
    font-size: 0.78rem;
    color: #dc2626;
    margin-top: 4px;
    font-weight: 500;
}
.modern-input input::placeholder { color: #9a8a7c; }
.modern-input textarea { resize: vertical; min-height: 96px; }

/* ---------- Password show/hide toggle ---------- */
.password-input .toggle-password {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #8a7a6e;
    font-size: 1rem;
    padding: 6px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.password-input .toggle-password:hover { color: #15803D; }
.password-input input { padding-left: 42px; }

/* ---------- Payment method (modern tiles) ---------- */
.payment-method { margin-bottom: 20px; }
.payment-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: 2px solid #e7dccf;
    border-radius: 14px;
    background: #fdfaf5;
    color: #3d342e;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}
.payment-option input { width: auto; margin: 0; }
.payment-option:hover { border-color: #15803D; background: #f0f7ee; }
.payment-option.selected {
    border-color: #15803D;
    background: #f0f7ee;
    color: #15803D;
    font-weight: 600;
}

/* ---------- Profile image circle ---------- */
.profile-avatar-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: #f0f7ee;
    color: #15803D;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem;
    flex-shrink: 0;
    border: 4px solid #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin: 0 auto 24px;
    object-fit: cover;
}
.profile-image-upload {
    margin-top: 18px;
    text-align: center;
}
.profile-image-input { display: none; }
.profile-image-btn {
    display: inline-flex;
    align-items: center; gap: 8px;
    padding: 10px 22px;
    border: 2px dashed #d4c6b0;
    border-radius: 14px;
    background: #f7f4ee;
    color: #15803D;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.profile-image-btn:hover { border-color: #15803D; background: #f0f7ee; }

/* ---------- Admin panel (custom) ---------- */
.admin-shell {
    display: flex;
    min-height: calc(100vh - 140px);
}
.admin-sidebar {
    width: 260px;
    background: #2d221d;
    color: #e8dfd1;
    flex-shrink: 0;
}
.admin-sidebar a {
    display: block;
    padding: 14px 20px;
    color: #b9ae9e;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.92rem;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: #3d342e;
    color: #fff;
    border-left-color: #15803D;
}
.admin-main { flex: 1; background: #fdfaf5; padding: 30px; overflow-y: auto; }
.admin-title { font-size: 1.7rem; color: #2d221d; margin-bottom: 26px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 30px; }
.admin-table-wrap { background: #fff; border: 1px solid #e7dccf; border-radius: 14px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: right; padding: 14px 16px; background: #f7f4ee; font-size: 0.85rem; color: #7a6f66; border-bottom: 1px solid #e7dccf; }
.admin-table td { padding: 12px 16px; font-size: 0.9rem; border-bottom: 1px solid #eef0ec; }
.admin-actions { margin-top: 20px; display: flex; gap: 10px; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.btn-ghost-outline {
    border: 1px solid #d4c6b0;
    color: #3d342e;
    background: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .product-detail-layout { grid-template-columns: 1fr; }
    .progress-tracker { gap: 6px; font-size: 0.75rem; }
    .step-circle { width: 26px; height: 26px; font-size: 0.75rem; }
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; border-bottom: 1px solid #3d342e; }
    .admin-sidebar { display: none; } /* hide on mobile, admin via desktop */
    .admin-main { padding: 16px; }
}
@media (max-width: 640px) {
    .header-flex { gap: 10px; }
    .main-nav { position: fixed; inset: 0 0 0 auto; width: 260px; background: #fff; border-left: 1px solid #e7dccf; flex-direction: column; padding-top: 80px; transform: translateX(100%); transition: transform 0.3s; z-index: 200; }
    .main-nav.nav-open { transform: translateX(0); }
    .main-nav .nav-list { flex-direction: column; gap: 0; padding: 0 16px; }
    .main-nav a { display: block; padding: 12px; border-radius: 0; }
    .hero { flex-direction: column; padding: 40px 20px; text-align: center; }
    .hero-actions { justify-content: center; }
    .hero-image { order: -1; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
    .product-image { height: 170px; }
    .category-image { height: 120px; }
    .newsletter form { flex-direction: column; }
    .newsletter input[type="email"] { width: 100%; }
    .messages-container { width: 94%; left: 3%; transform: none; }
    .section-padding { padding: 40px 0; }
}

/* ---------- Tablet (641px – 900px) ---------- */
@media (max-width: 900px) and (min-width: 641px) {
    .checkout-grid { grid-template-columns: 1fr; }
    .product-detail-layout { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .hero { padding: 50px 24px; }
    .section-padding { padding: 50px 0; }
    .section-title { font-size: 1.6rem; }
}

/* ---------- Show hamburger button on mobile ---------- */
@media (max-width: 640px) {
    .mobile-menu-btn { display: flex; }
}

/* ---------- Hamburger → X animation ---------- */
.hamburger {
    position: relative;
    width: 22px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #3d342e;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}
body.nav-open .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
body.nav-open .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}
body.nav-open .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Mobile nav overlay / backdrop ---------- */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
body.nav-open .mobile-nav-overlay {
    opacity: 1;
    visibility: visible;
}

/* ---------- Scroll lock ---------- */
body.nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    touch-action: none;
}

/* ---------- Mobile dropdown menus in hamburger drawer (≤640px) ---------- */
@media (max-width: 640px) {
    .nav-dropdown-menu {
        position: static;
        right: auto;
        top: auto;
        width: 100%;
        min-width: auto;
        border: none;
        box-shadow: none;
        background: #f7f4ee;
        margin-top: 8px;
        border-radius: 8px;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        padding: 0;
        display: none;
    }
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
        animation: slideDown 0.3s ease;
    }
    .nav-dropdown-menu a {
        display: block;
        padding: 10px 16px;
        font-size: 0.9rem;
        border-radius: 0;
        white-space: normal;
    }
    .nav-dropdown-menu a:hover {
        background: #f0f7ee;
        color: #15803D;
    }
    .nav-dropdown-toggle i {
        transition: transform 0.25s ease;
        display: inline-block;
    }
    .nav-dropdown.open > .nav-dropdown-toggle i {
        transform: rotate(180deg);
    }
}

/* ---------- Mobile: 430px ---------- */
@media (max-width: 430px) {
    .container { padding: 0 14px; }
    .section-padding { padding: 40px 0; }
    .section-title { font-size: 1.5rem; }
    .section-header.with-btn { flex-direction: column; gap: 12px; align-items: flex-start; }

    /* Header */
    .header-top .container { flex-direction: column; gap: 8px; text-align: center; }
    .top-links { justify-content: center; flex-wrap: wrap; gap: 8px; }
    .top-link { font-size: 0.8rem; padding: 3px 8px; }
    .header-main { padding: 12px 0; }
    .logo img { width: 70px; height: 70px; }
    .logo span { font-size: 1.25rem; }
    .logo { gap: 8px; }
    .header-actions { gap: 8px; }
    .icon-btn { width: 40px; height: 40px; }
    .cart-count { width: 16px; height: 16px; font-size: 0.65rem; top: -4px; left: -4px; }

    /* Mobile nav drawer */
    .main-nav { width: 280px; padding-top: 70px; }
    .main-nav .nav-list { padding: 0 16px; }
    .main-nav a { padding: 14px 12px; font-size: 1rem; border-radius: 10px; }

    /* Hero */
    .hero { flex-direction: column; padding: 40px 16px; text-align: center; gap: 24px; }
    .hero-content { text-align: center; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 0.95rem; max-width: 100%; margin: 0 auto 20px; }
    .hero-actions { justify-content: center; }
    .hero-image { order: -1; }
    .hero-img { border-radius: 16px; }

    /* Product grid */
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
    .product-image { height: 160px; }
    .product-card { border-radius: 14px; }
    .product-info { padding: 12px; }
    .product-name { font-size: 1rem; }
    .current-price { font-size: 1.05rem; }

    /* Category grid */
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .category-card { min-height: 200px; padding: 14px; }
    .category-image { height: 110px; }
    .category-name { font-size: 1rem; }

    /* Footer - stack into 2 columns on 430px */
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; padding: 40px 0 24px; }
    .footer-title { font-size: 1rem; margin-bottom: 12px; }
    .footer-text { font-size: 0.85rem; }
    .footer-links li { margin-bottom: 8px; }
    .footer-links a { font-size: 0.85rem; }
    .contact-list li { font-size: 0.85rem; margin-bottom: 8px; }
    .social-links a { width: 36px; height: 36px; font-size: 1rem; }
    .footer-bottom { padding: 20px 0; font-size: 0.8rem; }

    /* Buttons */
    .btn { padding: 10px 20px; font-size: 0.9rem; }
    .btn-large { padding: 14px 28px; font-size: 1rem; }
    .btn-block { width: 100%; }

    /* Forms */
    .form-group input, .form-group select, .form-group textarea {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    .auth-card { padding: 24px 16px; }
    .auth-card h1 { font-size: 1.5rem; }

    /* Cart */
    .cart-table { font-size: 0.85rem; }
    .cart-table th, .cart-table td { padding: 10px 12px; }
    .cart-item-img { width: 60px; height: 60px; }
    .cart-summary { padding: 20px; }

    /* Modals / Lightbox */
    .lightbox { padding: 6px; }
    .lightbox-image { max-height: 55vh; border-radius: 8px; }
    .lightbox-close { width: 40px; height: 40px; top: 8px; right: 8px; font-size: 1.25rem; }
    .lightbox-prev, .lightbox-next { width: 44px; height: 44px; font-size: 1.25rem; }
    .lightbox-thumb { width: 44px; height: 44px; }

    /* Tables - horizontal scroll on mobile */
    .orders-table, .cart-table, .wallet-transactions, .returns-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Profile shell - stack on mobile */
    .profile-shell { flex-direction: column; gap: 16px; }
    .profile-menu { width: 100%; flex-shrink: 1; }

    /* Filter bar */
    .filter-bar { gap: 8px; }
    .filter-btn { padding: 6px 12px; font-size: 0.82rem; }
    .sort-select { padding: 6px 10px; font-size: 0.82rem; }

    /* Progress tracker */
    .progress-tracker { gap: 4px; font-size: 0.7rem; }
    .step-circle { width: 24px; height: 24px; font-size: 0.7rem; }
    .step-label { font-size: 0.7rem; }

    /* Messages */
    .messages-container { width: 92%; left: 4%; transform: none; }
}

/* ---------- Mobile: 414px ---------- */
@media (max-width: 414px) {
    .hero-title { font-size: 1.7rem; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .product-image { height: 150px; }
    .category-card { min-height: 180px; }
    .category-image { height: 100px; }
    .footer-grid { gap: 20px; }
    .checkout-grid { gap: 16px; }
    .order-detail-grid { gap: 16px; }
    .contact-grid { gap: 20px; }
}

/* ---------- Mobile: 390px ---------- */
@media (max-width: 390px) {
    .hero-title { font-size: 1.6rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: 1fr; }
    .category-card { min-height: auto; }
}

/* ---------- Mobile: 375px ---------- */
@media (max-width: 375px) {
    .container { padding: 0 12px; }
    .hero { padding: 32px 16px; }
    .section-padding { padding: 32px 0; }
    .section-title { font-size: 1.4rem; }
    .product-grid { gap: 12px; }
    .product-image { height: 140px; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .profile-menu { padding: 16px 14px; }
    .menu-link { padding: 10px 12px; font-size: 0.9rem; }
    .auth-card { padding: 20px 14px; }
    .btn { padding: 10px 18px; font-size: 0.85rem; }
    .cart-summary { padding: 16px; }
    .newsletter form { gap: 8px; }
}

/* ---------- Mobile: 320px ---------- */
@media (max-width: 320px) {
    .container { padding: 0 10px; }
    .hero { padding: 28px 14px; }
    .hero-title { font-size: 1.5rem; }
    .hero-subtitle { font-size: 0.9rem; }
    .product-grid { grid-template-columns: 1fr; }
    .product-image { height: 130px; }
    .category-card { min-height: auto; padding: 12px; }
    .category-image { height: 90px; }
    .footer-grid { gap: 16px; padding: 32px 0 20px; }
    .footer-title { font-size: 0.95rem; }
    .footer-links li { margin-bottom: 6px; }
    .footer-links a { font-size: 0.8rem; }
    .contact-list li { font-size: 0.8rem; margin-bottom: 6px; }
    .social-links a { width: 34px; height: 34px; font-size: 0.95rem; }
    .btn { padding: 9px 16px; font-size: 0.85rem; }
    .auth-card { padding: 18px 12px; }
    .auth-card h1 { font-size: 1.4rem; }
    .cart-summary { padding: 14px; }
    .filter-bar { gap: 6px; }
    .messages-container { width: 90%; left: 5%; }
}

/* ---------- Touch-friendly target sizes ---------- */
button, .btn, .icon-btn, .mobile-menu-btn, .menu-link, .top-link, .footer-links a, .filter-btn, .sort-select {
    min-height: 44px;
}
button:active, .btn:active, .icon-btn:active, .mobile-menu-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}

/* ---------- Focus visible for accessibility ---------- */
button:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .mobile-menu-btn:focus-visible {
    outline: 2px solid var(--td-primary);
    outline-offset: 2px;
}

/* ---------- Prevent horizontal overflow ---------- */
body { overflow-x: hidden; }
html { overflow-x: hidden; }
.container { max-width: 100%; }

/* ---------- Dark mode overrides ---------- */
html.dark-mode .bg-light,
html.dark-mode .section-padding.bg-light {
    background: var(--td-bg-soft) !important;
}
html.dark-mode .product-card {
    background: var(--td-bg-card);
    border-color: var(--td-border);
    color: var(--td-text-body);
}
html.dark-mode .product-card:hover {
    border-color: var(--td-primary);
}
html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
    background: var(--td-input-bg);
    border-color: var(--td-input-border);
    color: var(--td-text-body);
}
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: var(--td-text-muted);
}
html.dark-mode .hero {
    background: linear-gradient(135deg, var(--td-bg-card) 0%, var(--td-bg-page) 100%);
}
html.dark-mode .hero,
html.dark-mode .hero-title,
html.dark-mode .hero-subtitle,
html.dark-mode .section-title,
html.dark-mode .section-subtitle,
html.dark-mode .category-name,
html.dark-mode .product-card h3,
html.dark-mode .product-card h4 {
    color: var(--td-text);
}
html.dark-mode .main-nav {
    background: var(--td-bg-card);
    border-left-color: var(--td-border);
}
html.dark-mode .main-nav a {
    color: var(--td-text-body);
}
html.dark-mode .main-nav a:hover,
html.dark-mode .main-nav a.active {
    color: var(--td-primary);
}
html.dark-mode .btn-outline {
    color: var(--td-primary);
    border-color: var(--td-primary);
}
html.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--td-border-light);
}

/* ---------- Dark mode: full-site component overrides ---------- */

/* --- Layout & header --- */
html.dark-mode .site-header { background: var(--td-bg); border-bottom-color: var(--td-border-light); }
html.dark-mode .header-top { background: var(--td-bg-card); border-bottom-color: var(--td-border-light); }
html.dark-mode .top-text i { color: #fbbf24; }
html.dark-mode .top-link { color: var(--td-text-body); }
html.dark-mode .top-link:hover { background: #2a221c; color: var(--td-text); }
html.dark-mode .header-main { border-bottom-color: var(--td-border-light); }
html.dark-mode .logo span { color: var(--td-text); }
html.dark-mode .logo i { color: #fbbf24; }
html.dark-mode .nav-dropdown-toggle:hover { background: #2a221c; color: var(--td-text); }
html.dark-mode .nav-dropdown-menu { background: var(--td-bg-card); border-color: var(--td-border); }
html.dark-mode .nav-dropdown-menu a { color: var(--td-text-body); }
html.dark-mode .nav-dropdown-menu a:hover { background: #2a221c; color: var(--td-text); }

/* --- Icons & secondary buttons --- */
html.dark-mode .icon-btn { background: rgba(255,255,255,0.06); border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .icon-btn:hover { background: var(--td-bg-soft); color: var(--td-text); }
html.dark-mode #themeToggle { background: rgba(255,255,255,0.06) !important; border-color: var(--td-border-light) !important; color: var(--td-text-body) !important; }
html.dark-mode .cart-count { background: var(--td-border-light); color: var(--td-text); }
html.dark-mode .top-link.btn-outline-sm { border-color: var(--td-primary) !important; color: var(--td-primary) !important; }
html.dark-mode .top-link.btn-outline-sm:hover { background: rgba(37,99,235,0.15) !important; color: var(--td-primary) !important; }
html.dark-mode .main-nav a:hover { background: rgba(255,255,255,0.06) !important; color: var(--td-text) !important; }
html.dark-mode .main-nav a.active { background: rgba(37,99,235,0.15) !important; }
html.dark-mode .mobile-menu-btn { background: var(--td-bg-card) !important; border-color: var(--td-border-light) !important; color: var(--td-text-body) !important; }
html.dark-mode .mobile-menu-btn:hover { background: var(--td-bg-soft) !important; color: var(--td-text) !important; }
html.dark-mode .nav-dropdown-toggle { color: var(--td-text-body) !important; }
html.dark-mode .btn-ghost { background: #2a221c; color: var(--td-text-body); border-color: var(--td-border-light); }
html.dark-mode .btn-ghost:hover { background: #3a2e26; color: var(--td-text); }

/* --- Star rating --- */
html.dark-mode .star-rating .star { color: #4a3a2e; }
html.dark-mode .star-rating .star.selected { color: #fbbf24; }

/* --- Product cards & grid --- */
html.dark-mode .product-image { background: var(--td-bg-soft); }
html.dark-mode .product-placeholder { background: #2a221c; color: var(--td-text-muted); }
html.dark-mode .product-actions { background: var(--td-bg-soft); border-color: var(--td-border-light); }
html.dark-mode .icon-action { background: rgba(255,255,255,0.05); color: var(--td-text-body); border-color: var(--td-border-light); }
html.dark-mode .icon-action:hover { background: var(--td-primary); color: #fff; border-color: var(--td-primary); }
html.dark-mode .product-category { color: var(--td-primary); }
html.dark-mode .product-name { color: var(--td-text); }
html.dark-mode .product-brand { color: var(--td-text-muted); }
html.dark-mode .product-price, html.dark-mode .current-price { color: var(--td-primary); }
html.dark-mode .old-price { color: var(--td-text-muted); }

/* --- Empty states --- */
html.dark-mode .empty-msg, html.dark-mode .empty-state { color: var(--td-text-muted); }
html.dark-mode .empty-state i { color: #5c4a3e; }
html.dark-mode .empty-state h3 { color: var(--td-text); }
html.dark-mode .empty-cart { color: var(--td-text-body); }
html.dark-mode .empty-cart i { color: #5c4a3e; }
html.dark-mode .empty-cart h2 { color: var(--td-text); }
html.dark-mode .empty-cart p { color: var(--td-text-muted); }

/* --- CTA, testimonials, newsletter --- */
html.dark-mode .cta-title, html.dark-mode .cta-text { color: var(--td-text); }
html.dark-mode .testimonial-card { background: var(--td-bg-card); border-color: var(--td-border); color: var(--td-text-body); }
html.dark-mode .stars { color: #fbbf24; }
html.dark-mode .testimonial-card p { color: var(--td-text-muted); }
html.dark-mode .testimonial-author { color: var(--td-text); }
html.dark-mode .newsletter h3 { color: var(--td-text); }
html.dark-mode .newsletter p { color: var(--td-text-muted); }
html.dark-mode .newsletter input[type="email"] { background: var(--td-input-bg); border-color: var(--td-input-border); color: var(--td-text-body); }

/* --- Footer --- */
html.dark-mode .site-footer { background: var(--td-bg-card); border-top-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .footer-title { color: var(--td-text); }
html.dark-mode .footer-text { color: var(--td-text-muted); }
html.dark-mode .social-links a { background: rgba(255,255,255,0.06); color: var(--td-text-body); border-color: var(--td-border-light); }
html.dark-mode .social-links a:hover { background: var(--td-primary); color: #fff; }
html.dark-mode .footer-links a { color: var(--td-text-body); }
html.dark-mode .footer-links a:hover { color: var(--td-primary); }
html.dark-mode .contact-list li { color: var(--td-text-body); }
html.dark-mode .contact-list li i { color: #fbbf24; }
html.dark-mode .footer-bottom { color: var(--td-text-muted); }

/* --- Messages & breadcrumb --- */
html.dark-mode .alert { background: #231c18; border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .alert-success { background: rgba(34,197,94,0.15); color: #86efac; border-color: rgba(34,197,94,0.3); }
html.dark-mode .alert-error { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
html.dark-mode .alert-warning { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
html.dark-mode .close-btn { color: var(--td-text-body); }
html.dark-mode .form-error { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
html.dark-mode .password-input .toggle-password { color: #b9ae9e; }
html.dark-mode .password-input .toggle-password:hover { color: #86efac; }
html.dark-mode .breadcrumb { border-bottom-color: var(--td-border-light); }
html.dark-mode .breadcrumb a { color: var(--td-primary); }

/* --- Product detail --- */
html.dark-mode .product-detail-layout { background: var(--td-bg-page); }
html.dark-mode .detail-gallery {background-color: #1d1814;border-color: var(--td-border);}
html.dark-mode .gallery-main {background: var(--td-bg-soft);border-color: var(--td-border);}
html.dark-mode .gallery-main img { background: var(--td-input-bg); }
html.dark-mode .gallery-count { color: var(--td-text-muted); }
html.dark-mode .gallery-title { color: var(--td-text); }
html.dark-mode .gallery-zoom-btn { background: var(--td-bg-card); color: var(--td-text-body); border-color: var(--td-border-light); }
html.dark-mode .gallery-zoom-btn:hover { background: var(--td-bg-soft); color: var(--td-text); }
html.dark-mode .thumb-nav { background: var(--td-input-bg); border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .thumb-nav:hover:not(:disabled) { background: var(--td-bg-soft); }
html.dark-mode .gallery-thumb { background: var(--td-input-bg); border-color: var(--td-border-light); }
html.dark-mode .gallery-thumb.active { border-color: var(--td-primary); box-shadow: 0 0 0 3px rgba(92,201,138,0.25); }
html.dark-mode .lightbox { background: rgba(0,0,0,0.85); }
html.dark-mode .lightbox-backdrop { background: rgba(0,0,0,0.6); }
html.dark-mode .lightbox-content { background: #14100d; border-color: var(--td-border); }
html.dark-mode .lightbox-close { background: rgba(255,255,255,0.1); color: var(--td-text); }
html.dark-mode .lightbox-close:hover { background: rgba(255,255,255,0.2); }
html.dark-mode .lightbox-prev, html.dark-mode .lightbox-next { background: rgba(255,255,255,0.1); color: var(--td-text); }
html.dark-mode .lightbox-prev:hover, html.dark-mode .lightbox-next:hover { background: rgba(255,255,255,0.2); }
html.dark-mode .lightbox-thumb { border-color: var(--td-border-light); }
html.dark-mode .lightbox-thumb.active { border-color: var(--td-primary); }

html.dark-mode .product-title { color: var(--td-text); }
html.dark-mode .product-rating { color: var(--td-text-muted); }
html.dark-mode .rating-text { color: var(--td-text-muted); }
html.dark-mode .product-price-detail { color: var(--td-text-body); }
html.dark-mode .stock-status { color: var(--td-text); }
html.dark-mode .stock-status.in-stock { background: rgba(34,197,94,0.15); color: #86efac; }
html.dark-mode .stock-status.out-of-stock { background: rgba(239,68,68,0.15); color: #fca5a5; }
html.dark-mode .product-short-desc { color: var(--td-text-muted); }
html.dark-mode .qty-selector label { color: var(--td-text-body); }
html.dark-mode .qty-btn { background: var(--td-bg-card); color: var(--td-text-body); border-color: var(--td-border-light); }
html.dark-mode .qty-btn:hover { background: var(--td-bg-soft); color: var(--td-text); }
html.dark-mode .qty-input { background: var(--td-input-bg); border-color: var(--td-input-border); color: var(--td-text-body); }
html.dark-mode .product-meta { border-top-color: var(--td-border-light); }
html.dark-mode .product-meta p { color: var(--td-text-muted); }
html.dark-mode .product-meta p strong { color: var(--td-text); }
html.dark-mode .product-description { color: var(--td-text-muted); }
html.dark-mode .product-description h3 { color: var(--td-text); }
html.dark-mode .product-description p { color: var(--td-text-muted); }
html.dark-mode .related-products h3 { color: var(--td-text); }

/* --- Filter bar & forms --- */
html.dark-mode .filter-bar { border-color: var(--td-border-light); background: var(--td-bg-soft); }
html.dark-mode .filter-label { color: var(--td-text-muted); }
html.dark-mode .filter-btn { background: var(--td-bg-card); color: var(--td-text-body); border-color: var(--td-border-light); }
html.dark-mode .filter-btn:hover { border-color: var(--td-primary); color: var(--td-primary); }
html.dark-mode .filter-btn.active { background: var(--td-primary); color: #fff; border-color: var(--td-primary); }
html.dark-mode .sort-select { background: var(--td-input-bg); border-color: var(--td-input-border); color: var(--td-text-body); }
html.dark-mode .form-group label { color: var(--td-text-body); }
html.dark-mode .form-group input, html.dark-mode .form-group select, html.dark-mode .form-group textarea { background: var(--td-input-bg); border-color: var(--td-input-border); color: var(--td-text-body); }
html.dark-mode .remember-row { color: var(--td-text-muted); }
html.dark-mode .auth-links a { color: var(--td-primary); }

/* --- Cart --- */
html.dark-mode .cart-table { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .cart-table th { background: var(--td-bg-soft); color: var(--td-text-muted); border-bottom-color: var(--td-border-light); }
html.dark-mode .cart-table td { color: var(--td-text-body); border-bottom-color: var(--td-border-light); }
html.dark-mode .cart-item-name { color: var(--td-text); }
html.dark-mode .cart-item-brand { color: var(--td-text-muted); }
html.dark-mode .cart-qty-form input[type="number"] { background: var(--td-input-bg); border-color: var(--td-input-border); color: var(--td-text-body); }
html.dark-mode .cart-summary { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .cart-summary-row { border-bottom-color: var(--td-border-light); }
html.dark-mode .cart-summary-row.total { color: var(--td-text); }

/* --- Checkout --- */
html.dark-mode .order-form h2 { color: var(--td-text); }
html.dark-mode .order-summary-card { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .order-summary-card h3 { color: var(--td-text); border-bottom-color: var(--td-border-light); }
html.dark-mode .payment-option { background: var(--td-bg-card); border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .payment-option span { color: var(--td-text-body); }
html.dark-mode .payment-option:hover { background: var(--td-bg-soft); border-color: var(--td-primary); }
html.dark-mode .payment-option input:checked + span { color: var(--td-primary); font-weight: 700; }
html.dark-mode .order-success h1 { color: var(--td-text); }
html.dark-mode .order-success p { color: var(--td-text-muted); }
html.dark-mode .order-meta p { color: var(--td-text-body); }
html.dark-mode .order-meta p strong { color: var(--td-text); }

/* --- Progress tracker --- */
html.dark-mode .progress-step .step-label { color: var(--td-text-muted); }
html.dark-mode .progress-step.active .step-label { color: var(--td-primary); }
html.dark-mode .step-circle { background: var(--td-input-bg); border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .progress-step.active .step-circle { background: var(--td-primary); color: #fff; border-color: var(--td-primary); }
html.dark-mode .progress-step.completed .step-circle { background: var(--td-primary); color: #fff; border-color: var(--td-primary); }

/* --- Order detail --- */
html.dark-mode .order-detail-box { background: var(--td-bg-card); border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .order-items-table th { background: var(--td-bg-soft); color: var(--td-text-muted); border-bottom-color: var(--td-border-light); }
html.dark-mode .order-items-table td { color: var(--td-text-body); border-bottom-color: var(--td-border-light); }

/* --- Order detail dark mode --- */
html.dark-mode .order-detail-grid { gap: 24px; }
html.dark-mode .order-header-wrap {
    background: var(--td-bg-card);
}
html.dark-mode .order-meta {
    background: var(--td-bg-card);
}
html.dark-mode .order-meta h1 { color: var(--td-text); }
html.dark-mode .order-number { color: var(--td-primary); }
html.dark-mode .order-date { color: var(--td-text-muted); }
html.dark-mode .order-badges { gap: 8px; }
html.dark-mode .status-badge { border-color: var(--td-border-light); }
html.dark-mode .status-pending_payment { background: #452a0a; color: #fcd34d; }
html.dark-mode .status-paid { background: #14532d; color: #86efac; }
html.dark-mode .status-preparing,
html.dark-mode .status-shipped { background: #1e3a5f; color: #93c5fd; }
html.dark-mode .status-delivered { background: #064e3b; color: #6ee7b7; }
html.dark-mode .status-cancelled { background: #450a0a; color: #fca5a5; }
html.dark-mode .order-items-card,
html.dark-mode .order-totals-card,
html.dark-mode .order-info-grid,
html.dark-mode .order-review-card {
    background: var(--td-bg-card);
    border-color: var(--td-border-light);
    color: var(--td-text-body);
}
html.dark-mode .order-items-card h3,
html.dark-mode .order-totals-card h3,
html.dark-mode .order-info-grid h3,
html.dark-mode .order-review-card h3,
html.dark-mode .info-card h3 {
    color: var(--td-text);
    border-bottom-color: var(--td-border);
}
html.dark-mode .orders-table th {
    color: var(--td-text-muted);
    border-bottom-color: var(--td-border-light);
}
html.dark-mode .orders-table td {
    color: var(--td-text-body);
    border-bottom-color: var(--td-border-light);
}
html.dark-mode .summary-row.total { color: var(--td-primary); }
html.dark-mode .info-card {
    background: var(--td-bg-card);
    border-color: var(--td-border-light);
    color: var(--td-text-body);
}

/* --- Contact page dark mode --- */
html.dark-mode .contact-grid { gap: 34px; }
html.dark-mode .contact-form-card {
    background: var(--td-bg-card);
    border-color: var(--td-border-light);
}
html.dark-mode .contact-form-title { color: var(--td-text); }
html.dark-mode .contact-info-card {
    background: var(--td-bg-card);
    border-color: var(--td-border-light);
}
html.dark-mode .contact-info-title { color: var(--td-text); }
html.dark-mode .contact-list-item { color: var(--td-text-body); }
html.dark-mode .contact-list-icon { color: #fbbf24; }
html.dark-mode .contact-email { color: var(--td-primary); }
html.dark-mode .contact-social-link {
    background: var(--td-bg-soft);
    color: var(--td-text);
}

/* --- Home dashboard stat cards --- */
html.dark-mode .stat-card { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .stat-card i { color: var(--td-primary); }
html.dark-mode .stat-card .stat-value { color: var(--td-text); }
html.dark-mode .stat-card .stat-label { color: var(--td-text-muted); }

/* --- Profile --- */
html.dark-mode .profile-card { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .profile-card-centered { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .profile-header { color: var(--td-text); }
html.dark-mode .profile-main-info h2 { color: var(--td-text); }
html.dark-mode .profile-username { color: var(--td-text-muted); }
html.dark-mode .profile-email { color: var(--td-text-muted); }
html.dark-mode .profile-item .label { color: var(--td-text-muted); }
html.dark-mode .profile-item .value { color: #000000; }
html.dark-mode .profile-shell { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .menu-title { color: var(--td-text-muted); }
html.dark-mode .menu-link { color: var(--td-text-body); }
html.dark-mode .menu-link i { color: var(--td-text-muted); }
html.dark-mode .menu-link:hover { background: var(--td-bg-soft); color: var(--td-text); }
html.dark-mode .menu-link.active { background: rgba(92,201,138,0.15); color: var(--td-primary); }
html.dark-mode .order-history-table { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .order-history-table th { background: var(--td-bg-soft); color: var(--td-text-muted); border-bottom-color: var(--td-border-light); }
html.dark-mode .order-history-table td { color: var(--td-text-body); border-bottom-color: var(--td-border-light); }

/* --- Auth pages --- */
html.dark-mode .auth-card { background: var(--td-bg-card); border-color: var(--td-border-light); }
html.dark-mode .auth-card h1 { color: var(--td-text); }
html.dark-mode .auth-subtitle { color: var(--td-text-muted); }
html.dark-mode .auth-subtitle a { color: var(--td-primary); }
html.dark-mode .modern-input label { color: var(--td-text-body); }
html.dark-mode .modern-input .req { color: #fbbf24; }
html.dark-mode .modern-input input, html.dark-mode .modern-input select, html.dark-mode .modern-input textarea { background: var(--td-input-bg); border-color: var(--td-input-border); color: var(--td-text-body); }
html.dark-mode .error-msg { color: #fca5a5; }
html.dark-mode .modern-input input::placeholder { color: #5c4a3e; }

/* --- Payment methods & image upload --- */
html.dark-mode .payment-option.selected { background: rgba(92,201,138,0.15); border-color: var(--td-primary); }
html.dark-mode .profile-image-btn { background: var(--td-bg-card); border-color: var(--td-border-light); color: var(--td-text-body); }
html.dark-mode .profile-image-btn:hover { border-color: var(--td-primary); background: var(--td-bg-soft); }

/* Wallet balance badge in payment options */
.wallet-balance {
    font-size: 0.85rem;
    font-weight: 600;
    color: #15803D;
    margin-left: 6px;
}
html.dark-mode .wallet-balance { color: #5cc98a; }


/* --- Wallet & Return Forms Dark Mode --- */

/* Wallet card */
html.dark-mode .wallet-card {
    background: var(--td-bg-card);
    border-color: var(--td-primary);
}
html.dark-mode .wallet-currency {
    background: rgba(92,201,138,0.15);
    border-color: rgba(92,201,138,0.3);
    color: var(--td-text-muted);
}
html.dark-mode .balance-label,
html.dark-mode .balance-unit {
    color: var(--td-text-muted);
}
html.dark-mode .balance-amount {
    color: var(--td-primary);
}
html.dark-mode .tx-type {
    background: #ffffff;
    color: #000000;
}
html.dark-mode .wallet-transactions th {
    background: var(--td-bg-soft);
    color: var(--td-text-muted);
    border-bottom-color: var(--td-border-light);
}
html.dark-mode .wallet-transactions td {
    color: var(--td-text-body);
    border-bottom-color: var(--td-border-light);
}

/* Charge form container */
html.dark-mode .charge-form-container {
    background: var(--td-bg-card);
    border-color: var(--td-border-light);
}
html.dark-mode .charge-form-container h3 {
    color: var(--td-text);
}
html.dark-mode .charge-form-container label {
    color: var(--td-text-body);
}

/* Alert overrides for wallet charge */
html.dark-mode .alert-error {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
}
html.dark-mode .alert-success {
    background: rgba(34,197,94,0.15);
    color: #86efac;
    border-color: rgba(34,197,94,0.3);
}

/* Return form card */
html.dark-mode .return-form-card {
    background: var(--td-bg-card) !important;
    border-color: var(--td-primary) !important;
}
html.dark-mode .return-form-card .order-summary {
    border-bottom-color: var(--td-border-light) !important;
}
html.dark-mode .form-section-title {
    color: var(--td-text-body);
}
html.dark-mode .modern-input {
    background: var(--td-input-bg) !important;
    border-color: var(--td-input-border) !important;
    color: var(--td-text-body) !important;
}
html.dark-mode .modern-input::placeholder {
    color: var(--td-text-muted);
}
html.dark-mode .modern-input input,
html.dark-mode .modern-input select,
html.dark-mode .modern-input textarea {
    background: var(--td-input-bg) !important;
    border-color: var(--td-input-border) !important;
    color: var(--td-text-body) !important;
}
html.dark-mode .addr-chip {
    background: #2a221c !important;
    color: var(--td-primary) !important;
    border-color: rgba(92,201,138,0.3) !important;
}
html.dark-mode .addr-chip:hover {
    background: var(--td-bg-soft) !important;
}
html.dark-mode .image-upload-area {
    background: var(--td-bg-soft) !important;
    border-color: var(--td-border-light) !important;
}
html.dark-mode .image-upload-area > div {
    color: var(--td-text-body);
}
html.dark-mode .image-preview-item {
    background: var(--td-bg-card) !important;
    border-color: var(--td-border-light) !important;
}

/* Order action buttons dark mode */
html.dark-mode .btn-wallet-pay,
html.dark-mode .btn-order-return {
    background: #1e3a5f !important;
    border-color: #93c5fd !important;
    color: #93c5fd !important;
}
html.dark-mode .btn-order-cancel {
    background: #452a0a !important;
    border-color: #fcd34d !important;
    color: #fcd34d !important;
}

/* Wallet charge button in wallet_detail.html */
html.dark-mode .btn-wallet-charge {
    background: #452a0a !important;
    border-color: #fcd34d !important;
    color: #fcd34d !important;
}

/* ============================================================
   Merged from root-level stray stylesheet
   (d:webnoghl_projectstaticstyle.css — consolidated into static/style.css,
    source file deleted after merge)
   ============================================================ */

/* ---------- Forms (auth/checkout/address) ---------- */
.form-field { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.form-field label { font-size:0.9rem; font-weight:600; color:#3d342e; }
.form-field input,
.form-field select,
.form-field textarea {
    padding:12px 14px; border:1px solid #d4c6b0; border-radius:10px;
    background:#fff; color:#3d342e; font-family:inherit; font-size:inherit;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline:none; border-color:#15803D; box-shadow:0 0 0 3px rgba(21,128,61,0.1);
}
.req { color:#b45309; }
.field-hint { font-size:0.8rem; color:#7a6f66; margin-top:2px; }
.error-msg { color:#991b1b; font-size:0.8rem; margin-top:4px; }
.form-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:20px; }
.mt-10 { margin-top:10px; }
.mt-30 { margin-top:30px; }
.d-inline-block { display:inline-block; }

/* ---------- Generic orders table ---------- */
.orders-table { width:100%; border-collapse:separate; border-spacing:0; background:#fff;
    border-radius:12px; overflow:hidden; border:1px solid #e7dccf; margin-bottom:20px; }
.orders-table th {
    text-align:right; padding:14px 16px; font-size:0.85rem; font-weight:600;
    color:#7a6f66; background:#f7f4ee; border-bottom:1px solid #e7dccf;
}
.orders-table td {
    padding:14px 16px; font-size:0.9rem; color:#3d342e; border-bottom:1px solid #eef0ec;
    vertical-align:middle;
}
.orders-table tr:last-child td { border-bottom:none; }

/* ---------- Checkout summary ---------- */
.summary-items { list-style:none; margin:0 0 16px 0; padding:0; }
.summary-item {
    display:flex; justify-content:space-between; padding:10px 0;
    border-bottom:1px solid #f0efe8; font-size:0.92rem; color:#3d342e;
}
.summary-item:last-child { border-bottom:none; }
.summary-name { text-align:right; }
.summary-qty { color:#7a6f66; }
.summary-price { font-weight:700; color:#15803D; text-align:left; }
.summary-divider { height:1px; background:#f0efe8; margin:12px 0; }
.summary-row { display:flex; justify-content:space-between; padding:8px 0;
    font-size:0.95rem; color:#3d342e; }
.summary-row.free span { color:#166534; font-weight:700; }
.summary-row.total {
    font-size:1.15rem; font-weight:800; color:#15803D;
    border-top:2px solid #e7dccf; padding-top:14px; margin-top:8px;
}
.payment-method { margin-top:10px; }
.payment-note { font-size:0.82rem; color:#7a6f66; margin-top:6px; }

/* ---------- Order success ---------- */
.success-card {
    max-width:700px; margin:0 auto; text-align:center; background:#fff;
    border:1px solid #e7dccf; border-radius:20px; padding:40px 24px;
}
.success-icon {
    width:60px; height:60px; border-radius:50%; background:#dcfce7; color:#166534;
    display:flex; align-items:center; justify-content:center; font-size:2rem;
    margin:0 auto 20px;
}
.success-title { font-size:1.75rem; color:#2d221d; margin-bottom:10px; }
.success-sub { color:#7a6f66; margin-bottom:30px; font-size:1.05rem; }
.order-info { text-align:right; margin-bottom:30px; }
.info-row {
    display:flex; justify-content:space-between; padding:10px 0;
    border-bottom:1px solid #f0efe8; font-size:0.95rem; color:#3d342e;
}
.info-row:last-child { border-bottom:none; }
.info-row .label { color:#7a6f66; font-weight:500; }
.info-row .value { font-weight:700; color:#2d221d; text-align:left; }
.info-row.total { font-size:1.1rem; font-weight:800; color:#15803D; }
.success-actions { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }

/* ---------- Order detail ---------- */
.order-detail-grid {
    display:grid; grid-template-columns: 1fr 340px; gap:30px; align-items:start;
}
.order-header-wrap {
    display:flex; justify-content:space-between; align-items:flex-start;
    gap:20px; flex-wrap:wrap; margin-bottom:24px;
}
.order-meta h1 { font-size:1.5rem; color:#2d221d; margin:0 0 4px 0; }
.order-meta .order-number { color:#15803D; font-weight:800; }
.order-date { font-size:0.9rem; color:#7a6f66; }
.order-badges { display:flex; gap:8px; flex-wrap:wrap; }
.order-items-card, .order-totals-card {
    background:#fff; border:1px solid #e7dccf; border-radius:16px;
    padding:22px; margin-bottom:24px;
}
.order-items-card h3, .order-totals-card h3 {
    font-size:1.15rem; color:#2d221d; margin-bottom:16px;
    border-bottom:1px solid #f0efe8; padding-bottom:10px;
}
.order-info-grid {
    display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap:16px; margin-top:30px;
}
.info-card {
    background:#fff; border:1px solid #e7dccf; border-radius:16px; padding:18px;
}
.info-card h3 {
    font-size:1.05rem; color:#2d221d; margin-bottom:12px;
    border-bottom:1px solid #f0efe8; padding-bottom:8px;
}
.info-card p { font-size:0.9rem; color:#5c4a3e; margin:6px 0; }
.order-progress { margin-top:30px; }

/* ---------- Profile ---------- */
.profile-field {
    display:flex; justify-content:space-between; padding:10px 0;
    border-bottom:1px solid #f0efe8; font-size:0.92rem;
}
.profile-field:last-child { border-bottom:none; }
.profile-field .label { color:#7a6f66; font-weight:500; }
.profile-field .value { font-weight:600; color:#2d221d; text-align:left; }
.profile-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:20px; }

/* ---------- Addresses ---------- */
.address-list { list-style:none; margin:0; padding:0; }
.address-item {
    background:#fff; border:1px solid #e7dccf; border-radius:14px;
    padding:16px; margin-bottom:12px; display:flex;
    justify-content:space-between; align-items:flex-start; gap:12px;
}
.address-item.default { border-color:#15803D; background:#f0f7ee; }
.address-info { flex:1; }
.address-title {
    display:flex; align-items:center; gap:8px; margin-bottom:8px;
    font-size:0.95rem; color:#2d221d; font-weight:600;
}
.badge-default {
    background:#15803D; color:#fff; font-size:0.72rem; padding:2px 8px;
    border-radius:10px; font-weight:700; margin-left:6px;
}
.address-body {
    font-size:0.88rem; color:#5c4a3e; display:flex;
    justify-content:space-between; margin:4px 0;
}
.address-body i { color:#b45309; width:16px; }
.address-actions { display:flex; gap:8px; flex-shrink:0; }
.btn-delete { color:#991b1b; border-color:#fecaca; background:#fef2f2; }
.btn-delete:hover { background:#fee2e2; }

/* ---------- Buttons ---------- */
.btn-danger { background:#991b1b; color:#fff; }
.btn-danger:hover { background:#7f1d1d; }

@media (max-width: 900px) {
    .order-detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Management panel components: dark mode ---------- */
html.dark-mode .mg-card{ background:var(--td-bg-card)!important; border-color:var(--td-border)!important; color:var(--td-text-body)!important; }
html.dark-mode .mg-card-header{ border-bottom-color:var(--td-border-light)!important; }
html.dark-mode .mg-card-header h3, html.dark-mode .mg-card-header i{ color:var(--td-text)!important; }
html.dark-mode .mg-card-body{ background:var(--td-bg-card)!important; }
html.dark-mode .mg-table{ background:var(--td-bg-card)!important; }
html.dark-mode .mg-table th{ background:var(--td-bg-soft)!important; color:var(--td-text-muted)!important; border-bottom-color:var(--td-border-light)!important; }
html.dark-mode .mg-table td{ color:var(--td-text-body)!important; border-bottom-color:var(--td-border-light)!important; }
html.dark-mode .mg-select, html.dark-mode .mg-input{ background:var(--td-input-bg)!important; border-color:var(--td-input-border)!important; color:var(--td-text-body)!important; }
html.dark-mode .mg-btn.mg-btn-primary{ background:var(--td-primary)!important; color:#fff!important; }
html.dark-mode .mg-btn.mg-btn-ghost, html.dark-mode .mg-btn.mg-btn-outline{ background:transparent!important; color:var(--td-text-body)!important; border-color:var(--td-border-light)!important; }
html.dark-mode .mg-badge-pill{ color:var(--td-text-body)!important; }
html.dark-mode .mg-filter-bar{ background:var(--td-bg-soft)!important; border-color:var(--td-border)!important; }
html.dark-mode .mg-filter-label{ color:var(--td-text-muted)!important; }
html.dark-mode .mg-stat-card{ background:var(--td-bg-card)!important; border-color:var(--td-border)!important; color:var(--td-text-body)!important; }
html.dark-mode .mg-stat-card .mg-stat-value{ color:var(--td-text)!important; }
html.dark-mode .mg-stat-card .mg-stat-label{ color:var(--td-text-muted)!important; }
html.dark-mode .mg-stat-card i{ color:var(--td-primary)!important; }
html.dark-mode .mg-empty{ background:var(--td-bg-card)!important; color:var(--td-text-body)!important; }
html.dark-mode .mg-empty i{ color:var(--td-text-muted)!important; }
html.dark-mode .mg-alert{ background:var(--td-bg-soft)!important; border-color:var(--td-border-light)!important; color:var(--td-text-body)!important; }
html.dark-mode .mg-page-header{ color:var(--td-text)!important; }
html.dark-mode .mg-info-item{ color:var(--td-text-body)!important; }
html.dark-mode .mg-info-label{ color:var(--td-text-muted)!important; }
html.dark-mode .mg-info-value{ color:var(--td-text-body)!important; }
html.dark-mode .mg-pagination a, html.dark-mode .mg-pagination span{ color:var(--td-text-body)!important; }

