@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

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

:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --primary: #2874F0;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --border: #e2e8f0;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  --accent: #f1f5f9;
  --radius: 0.5rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
}

img, svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}


html { scroll-behavior: smooth; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ===== UTILITY ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
@media(min-width:640px) { .container { padding: 0 1.5rem; } }
@media(min-width:1024px) { .container { padding: 0 2rem; } }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.hidden { display: none; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-extrabold { font-weight: 800; }
.text-center { text-align: center; }
.rounded { border-radius: var(--radius); }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.z-10 { z-index: 10; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }
.inset-0 { top:0; right:0; bottom:0; left:0; }
.top-0 { top: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.875rem; transition: all 0.2s;
  cursor: pointer; border: none; line-height: 1;
}
.btn-primary {
  background: var(--primary); color: var(--primary-foreground);
  box-shadow: var(--shadow);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline {
  background: transparent; color: var(--foreground);
  border: 2px solid var(--border);
}
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--muted); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; border-radius: 0.75rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-destructive { background: var(--destructive); color: white; }

/* ===== FORM ELEMENTS ===== */
.form-input {
  width: 100%; padding: 0.625rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background); color: var(--foreground);
  font-size: 0.875rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(40,116,240,0.1);
}
.form-input.error { border-color: var(--destructive); }
.form-label { display: block; font-weight: 500; font-size: 0.875rem; margin-bottom: 0.35rem; }
.form-textarea { min-height: 100px; resize: vertical; }
.form-error { color: var(--destructive); font-size: 0.75rem; margin-top: 0.25rem; display: flex; align-items: center; gap: 0.25rem; }
.form-group { margin-bottom: 1rem; }
.form-select {
  width: 100%; padding: 0.625rem 2rem 0.625rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") right 0.5rem center/1.25rem no-repeat;
  color: var(--foreground); font-size: 0.875rem; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(40,116,240,0.1); }

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 40;
  background: var(--primary); color: white;
  box-shadow: 0 2px 8px rgba(40,116,240,0.3);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1rem; max-width: 1280px; margin: 0 auto;
}
.header-logo {
  font-size: 1.4rem; font-weight: 800; color: white;
  white-space: nowrap; flex-shrink: 0;
}
.header-logo img { height: 36px; object-fit: contain; }
.header-search {
  flex: 1; display: flex; max-width: 680px;
  background: white; border-radius: 0.375rem; overflow: hidden;
}
.header-search input {
  flex: 1; padding: 0.6rem 1rem; border: none; outline: none;
  font-size: 0.875rem; color: var(--foreground);
}
.header-search button {
  background: #f0c040; padding: 0 1rem; border: none; cursor: pointer;
  display: flex; align-items: center;
}
.header-search button svg { width: 20px; height: 20px; color: #333; }
.header-nav { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.header-nav-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.35rem 0.75rem; border-radius: 0.375rem;
  color: white; font-size: 0.75rem; white-space: nowrap;
  cursor: pointer; transition: background 0.15s;
}
.header-nav-item:hover { background: rgba(255,255,255,0.15); }
.header-nav-item span { font-weight: 600; font-size: 0.875rem; }
.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #f0c040; color: #333; font-size: 0.7rem; font-weight: 800;
  width: 18px; height: 18px; border-radius: 50%; margin-left: 0.25rem; vertical-align: middle;
}
@media(max-width:768px) {
  .header-search { max-width: 100%; order: 3; flex: none; width: 100%; }
  .header-inner { flex-wrap: wrap; }
  .header-logo { order: 1; }
  .header-nav { order: 2; }
}

/* ===== CATEGORY BAR ===== */
.category-bar {
  position: sticky; top: 64px; z-index: 30; background: white;
  border-bottom: 1px solid var(--border); padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}
.category-scroll { display: flex; overflow-x: auto; gap: 0.75rem; padding: 0 1rem; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.category-btn {
  white-space: nowrap; padding: 0.5rem 1.25rem; border-radius: 9999px;
  font-weight: 600; font-size: 0.875rem; transition: all 0.15s;
  border: 2px solid var(--border); background: white; color: var(--foreground);
  flex-shrink: 0;
}
.category-btn:hover { border-color: var(--primary); color: var(--primary); }
.category-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== HERO SECTION ===== */
.hero {
  background: var(--primary); color: white; padding: 4rem 0;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('https://images.unsplash.com/photo-1607082348824-0a96f2a4b9da?auto=format&fit=crop&w=2000&q=80') center/cover no-repeat;
  opacity: 0.1; mix-blend-mode: overlay;
}
.hero-content { position: relative; z-index: 1; max-width: 600px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.hero-btn {
  display: inline-flex; align-items: center; background: white; color: var(--foreground);
  font-weight: 700; padding: 0.875rem 2.5rem; border-radius: 9999px;
  box-shadow: var(--shadow-lg); transition: all 0.2s; font-size: 1rem;
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }

/* ===== PRODUCT CARDS ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.25rem;
}
@media(min-width:640px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    padding: 0;
  }
}
.product-card {
  width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem;
  overflow: hidden; transition: all 0.2s; cursor: pointer;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.product-card-img {
  aspect-ratio: 1 !important; background: var(--muted) !important; padding: 0.25rem !important; display: flex !important;
  align-items: center !important; justify-content: center !important; position: relative !important; overflow: hidden !important;
}
.product-card-img img {
  width: 100% !important; height: 100% !important; object-fit: contain !important; mix-blend-mode: multiply !important;
}
.discount-badge {
  position: absolute !important; top: 0.35rem !important; right: 0.35rem !important;
  background: #16a34a !important; color: white !important;
  font-weight: 800 !important; font-size: 0.6rem !important; padding: 0.15rem 0.35rem !important; border-radius: 0.25rem !important;
  z-index: 10 !important;
}
.product-card-body { padding: 0.5rem !important; }
.product-card-category { font-size: 0.55rem !important; font-weight: 700 !important; margin-bottom: 0.15rem !important; }
.product-card-name {
  font-weight: 600 !important; font-size: 0.7rem !important; line-height: 1.2 !important;
  height: 1.7rem !important; margin-bottom: 0.25rem !important;
}
.price-current { font-size: 0.85rem !important; font-weight: 800 !important; }
.price-original { font-size: 0.65rem !important; text-decoration: line-through !important; color: var(--muted-foreground) !important; }
.price-discount { font-size: 0.65rem !important; font-weight: 800 !important; color: #16a34a !important; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; padding: 0.2rem 0.6rem;
  border-radius: 9999px; font-size: 0.75rem; font-weight: 600;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: var(--muted); color: var(--muted-foreground); }
.badge-purple { background: #f3e8ff; color: #7e22ce; }

/* ===== CARDS ===== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 1rem; padding: 1rem; box-shadow: var(--shadow-sm);
}
.card-lg { padding: 1.25rem; }

@media(min-width:640px) {
  .card { padding: 1.5rem; }
  .card-lg { padding: 2rem; }
}


/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: 1rem; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--muted); }
thead th { padding: 1rem 1.5rem; font-weight: 600; color: var(--muted-foreground); text-align: left; border-bottom: 1px solid var(--border); }
tbody td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--muted); }

/* ===== ALERTS ===== */
.alert { padding: 1rem; border-radius: 0.75rem; display: flex; align-items: flex-start; gap: 0.75rem; font-size: 0.875rem; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; min-width: 300px; }
.toast {
  padding: 0.875rem 1.25rem; border-radius: 0.75rem; box-shadow: var(--shadow-lg);
  font-weight: 600; font-size: 0.9rem; animation: slideDown 0.3s ease;
  display: flex; align-items: center; gap: 0.5rem;
}
.toast-success { background: #166534; color: white; }
.toast-error { background: #b91c1c; color: white; }
.toast-info { background: #1e40af; color: white; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== SPINNER ===== */
.spinner {
  width: 2rem; height: 2rem; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 4rem; }

/* ===== FOOTER ===== */
.footer {
  background: var(--foreground); color: #94a3b8;
  padding: 2rem 0; margin-top: auto; font-size: 0.875rem;
}
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 1rem; text-align: center; }

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: white; border-top: 1px solid var(--border); padding: 0.5rem 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}
.mobile-nav-inner { display: flex; justify-content: space-around; align-items: center; max-width: 480px; margin: 0 auto; }
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.35rem 1rem; border-radius: 0.5rem; color: var(--muted-foreground);
  font-size: 0.65rem; font-weight: 600; transition: color 0.15s;
}
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--primary); }
.mobile-nav-item svg { width: 22px; height: 22px; }
@media(max-width:768px) { .mobile-nav { display: block; } body { padding-bottom: 5rem; } }

/* ===== ADMIN HEADER ===== */
.admin-header {
  background: white; border-bottom: 1px solid var(--border);
  padding: 1rem; position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow-sm);
}
.admin-header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.admin-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.admin-nav a {
  padding: 0.4rem 0.875rem; border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 600; color: var(--muted-foreground); transition: all 0.15s;
}
.admin-nav a:hover, .admin-nav a.active { background: var(--primary); color: white; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.75rem 1.25rem; font-weight: 600; font-size: 0.875rem;
  color: var(--muted-foreground); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.15s; cursor: pointer;
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: 1.5rem; max-width: 640px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 2rem;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--muted); cursor: pointer; }

/* ===== STAR RATING ===== */
.star-rating { display: flex; gap: 0.25rem; }
.star { width: 1.25rem; height: 1.25rem; color: #d1d5db; }
.star.filled { color: #f59e0b; fill: #f59e0b; }
.star-lg { width: 2rem; height: 2rem; }
.star-btn { cursor: pointer; transition: transform 0.15s; }
.star-btn:hover { transform: scale(1.15); }

/* ===== SECTION TITLES ===== */
.section-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.section-subtitle { color: var(--muted-foreground); font-size: 0.875rem; margin-top: 0.25rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  background: var(--muted); border-radius: 1rem; border: 2px dashed var(--border);
}
.empty-state-icon { width: 5rem; height: 5rem; margin: 0 auto 1.5rem; color: var(--muted-foreground); opacity: 0.4; }

/* ===== QUANTITY CONTROL ===== */
.qty-control {
  display: flex; align-items: center; background: white;
  border: 1px solid var(--border); border-radius: 9999px; padding: 0.25rem;
  box-shadow: var(--shadow-sm); width: fit-content;
}
.qty-btn {
  width: 2.25rem; height: 2.25rem; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; font-size: 1.1rem; font-weight: 700; transition: background 0.15s;
  color: var(--foreground);
}
.qty-btn:hover { background: var(--muted); }
.qty-value { width: 3rem; text-align: center; font-weight: 700; font-size: 1.1rem; }

/* ===== IMAGE UPLOAD ===== */
.img-upload-area {
  border: 2px dashed var(--border); border-radius: 0.75rem; padding: 2rem;
  text-align: center; cursor: pointer; transition: all 0.2s; color: var(--muted-foreground);
}
.img-upload-area:hover { border-color: var(--primary); color: var(--primary); background: rgba(40,116,240,0.03); }

/* ===== ORDER TIMELINE ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0.5rem; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: -1.625rem; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; border: 2px solid white;
  box-shadow: 0 0 0 2px var(--border); background: var(--muted-foreground);
}
.timeline-dot.done { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }
.timeline-dot.current { background: var(--primary); box-shadow: 0 0 0 3px rgba(40,116,240,0.3); }

/* ===== PAYMENT QR ===== */
.qr-box {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.75rem;
  padding: 1.5rem; text-align: center;
}
.qr-box canvas, .qr-box img { margin: 0 auto 1rem; }

/* ===== RESPONSIVE GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media(min-width:640px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media(min-width:1024px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ===== CHECKOUT ===== */
.checkout-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:1024px) { .checkout-grid { grid-template-columns: 2fr 1fr; } }

/* ===== PRODUCT DETAIL GRID ===== */
.product-detail-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media(min-width:1024px) { .product-detail-grid { grid-template-columns: 1fr 1fr; } }

/* ===== DELIVERY BADGES ===== */
.delivery-badge {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem;
  border-radius: 0.75rem; font-size: 0.875rem; font-weight: 700;
}
.delivery-badge-fast { background: #f3e8ff; border: 1px solid #e9d5ff; color: #7e22ce; }
.delivery-badge-return { background: #dbeafe; border: 1px solid #bfdbfe; color: #1d4ed8; }
.delivery-badge-cod { background: #dcfce7; border: 1px solid #bbf7d0; color: #15803d; }

/* ===== MISC ===== */
.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.text-success { color: #16a34a; }
.text-danger { color: var(--destructive); }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.line-through { text-decoration: line-through; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.whitespace-pre-line { white-space: pre-line; }
.prose { max-width: none; line-height: 1.7; }

/* ===== SEARCH INPUT ===== */
.search-wrap { position: relative; }
.search-wrap .form-input { padding-left: 2.5rem; }
.search-wrap svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--muted-foreground); }
/* ===== CHECKOUT PAGE COMPLETE FIX ===== */

/* Main checkout grid fix */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
}

@media(min-width: 1024px) {
  .checkout-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
  }
}

/* Order Summary Card */
.checkout-grid > div:last-child .card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
  width: 100%;
}

/* Summary Title */
.checkout-grid > div:last-child .card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--foreground);
  border-bottom: 3px solid var(--primary);
  display: inline-block;
  padding-bottom: 0.5rem;
}

/* Summary Items */
#summary-items {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  max-height: 350px;
  overflow-y: auto;
}

/* Individual Item */
#summary-items > div {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--muted);
  border-radius: 0.75rem;
  align-items: center;
}

/* Product Image */
#summary-items img {
  width: 65px;
  height: 65px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: white;
  padding: 5px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

/* Product Details */
#summary-items > div > div:first-child {
  flex: 1;
  min-width: 0;
}

/* Product Name */
#summary-items > div > div:first-child > div:first-child {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.35rem;
  line-height: 1.3;
  word-wrap: break-word;
}

/* Quantity */
#summary-items > div > div:first-child > div:last-child {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  background: white;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
}

/* Item Price */
#summary-items > div > div:last-child {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===== SUMMARY ROWS - SUBTOTAL, DELIVERY, TOTAL ===== */
/* Fix for the rows - Left and Right alignment */
.checkout-grid > div:last-child .card > div:nth-child(3),
.checkout-grid > div:last-child .card > div:nth-child(4),
.checkout-grid > div:last-child .card > div:nth-child(5) {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 0.75rem !important;
  font-size: 0.9rem !important;
}

/* Subtotal Row */
.checkout-grid > div:last-child .card > div:nth-child(3) span:first-child,
.checkout-grid > div:last-child .card > div:nth-child(4) span:first-child,
.checkout-grid > div:last-child .card > div:nth-child(5) span:first-child {
  color: var(--muted-foreground);
  font-weight: 500;
}

.checkout-grid > div:last-child .card > div:nth-child(3) span:last-child,
.checkout-grid > div:last-child .card > div:nth-child(4) span:last-child,
.checkout-grid > div:last-child .card > div:nth-child(5) span:last-child {
  font-weight: 700;
  color: var(--foreground);
}

/* Delivery Row - Green color */
.checkout-grid > div:last-child .card > div:nth-child(4) span:last-child {
  color: #16a34a !important;
}

/* Total Row */
.checkout-grid > div:last-child .card > div:nth-child(5) {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--border);
  font-size: 1.1rem;
}

.checkout-grid > div:last-child .card > div:nth-child(5) span:first-child {
  font-weight: 800;
  color: var(--foreground);
  font-size: 1.1rem;
}

.checkout-grid > div:last-child .card > div:nth-child(5) span:last-child {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
}

/* ===== SECURE CHECKOUT BADGE - FIX ICON SIZE ===== */
.checkout-grid > div:last-child .card > div:nth-child(6) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  background: var(--muted) !important;
  padding: 0.75rem !important;
  border-radius: 0.5rem !important;
  margin: 1.25rem 0 !important;
  font-size: 0.75rem !important;
  color: var(--muted-foreground) !important;
}

/* Fix for the SVG icon - SMALL SIZE */
.checkout-grid > div:last-child .card > div:nth-child(6) svg {
  width: 1rem !important;
  height: 1rem !important;
  flex-shrink: 0 !important;
  color: #16a34a !important;
}

.checkout-grid > div:last-child .card > div:nth-child(6) span {
  font-size: 0.75rem !important;
}

/* Place Order Button */
#place-order-btn {
  width: 100% !important;
  padding: 0.875rem !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  background: var(--primary) !important;
  color: white !important;
  border-radius: 0.75rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.3s !important;
}

#place-order-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Mobile Responsive */
@media(max-width: 768px) {
  .checkout-grid > div:last-child .card {
    padding: 1rem;
  }
  
  #summary-items img {
    width: 55px;
    height: 55px;
  }
  
  #summary-items > div > div:first-child > div:first-child {
    font-size: 0.75rem;
  }
  
  .checkout-grid > div:last-child .card > div:nth-child(5) span:last-child {
    font-size: 1.1rem;
  }
}

@media(max-width: 480px) {
  #summary-items > div {
    flex-wrap: wrap;
  }
  
  #summary-items > div > div:first-child {
    min-width: calc(100% - 120px);
  }
  
  #summary-items > div > div:last-child {
    margin-left: auto;
  }
}
/* ===== COMPLETE CHECKOUT GAP FIXES ===== */

/* Main checkout grid - left and right columns ke beech gap */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem !important;
}

@media(min-width: 1024px) {
  .checkout-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem !important;
  }
}

/* LEFT COLUMN - Delivery aur Payment card ke beech GAP */
.checkout-grid > div:first-child {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5rem !important;
}

/* LEFT COLUMN - Cards ke beech margin hatao */
.checkout-grid > div:first-child .card {
  margin: 0 !important;
}

/* RIGHT COLUMN - Order Summary card */
.checkout-grid > div:last-child .card {
  margin: 0 !important;
}

/* Payment options ke beech gap */
#pay-upi-wrap,
#pay-cod-wrap {
  margin-bottom: 0.75rem !important;
}

#pay-cod-wrap {
  margin-bottom: 0 !important;
}

/* Delivery card aur payment card dono ko same padding */
.card.card-lg {
  padding: 1.5rem !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .checkout-grid {
    gap: 1rem !important;
  }
  
  .checkout-grid > div:first-child {
    gap: 1rem !important;
  }
  
  .card.card-lg {
    padding: 1rem !important;
  }
}
