/* DeepFix Catalog Connector — styled to mirror the deepfix storefront cards,
   using neutral tokens so it sits naturally in the host (MSPK) theme.
   Inherits the theme's fonts (no font-family overrides). */

.dfc-wrap {
  --dfc-ink: #111827;
  --dfc-muted: #6b7280;
  --dfc-line: #e9edf1;
  --dfc-bg: #f5f7f9;
  --dfc-accent: #128c7e;   /* buttons/links accent */
  --dfc-sale: #16a34a;
  --dfc-new: #f5b301;
  --dfc-star: #f59e0b;
  --dfc-radius: 14px;
  --dfc-cols: 4;
  color: var(--dfc-ink);
}
.dfc-container { max-width: 1200px; margin: 0 auto; padding: 16px 16px 56px; }

.dfc-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dfc-title { margin: 0; line-height: 1.15; }
.dfc-h2 { margin: 28px 0 16px; font-size: 1.35rem; font-weight: 700; }
.dfc-crumbs { font-size: .85rem; color: var(--dfc-muted); margin-bottom: 12px; }
.dfc-crumbs a { text-decoration: none; color: inherit; }
.dfc-crumbs a:hover { text-decoration: underline; }

/* Search */
.dfc-search { display: flex; gap: 8px; }
.dfc-search-field { position: relative; flex: 1; display: flex; }
.dfc-search-field input { flex: 1; min-width: 180px; width: 100%; padding: 11px 40px 11px 14px; border: 1px solid #d7dde3; border-radius: 10px; font: inherit; }
.dfc-search-clear { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,.08); color: #333; text-decoration: none; font-size: 16px; line-height: 1; }
.dfc-search-clear:hover { background: rgba(0,0,0,.16); }
.dfc-search button { padding: 11px 20px; border: 0; border-radius: 10px; background: var(--dfc-ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.dfc-search button:hover { background: #374151; }

/* Grid — 2 cols phones, 3 tablet, N (default 4) desktop, like deepfix */
.dfc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px)  { .dfc-grid { gap: 16px; } }
@media (min-width: 768px)  { .dfc-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1024px) { .dfc-grid { grid-template-columns: repeat(var(--dfc-cols, 4), 1fr); } }

/* Card */
.dfc-card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--dfc-line); border-radius: var(--dfc-radius); box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s; }
.dfc-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(16,24,40,.12); }
.dfc-card-media { position: relative; display: block; }
.dfc-card-img { position: relative; aspect-ratio: 1/1; background: var(--dfc-bg); overflow: hidden; }
.dfc-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform .5s cubic-bezier(.16,1,.3,1); }
.dfc-card:hover .dfc-card-img img { transform: scale(1.08); }

/* Badges (top-left, stacked) */
.dfc-badges { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.dfc-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.12); color: #fff; letter-spacing: .01em; }
.dfc-badge.sale { background: var(--dfc-sale); }
.dfc-badge.new { background: var(--dfc-new); color: #1f2937; }
.dfc-badge.oos { background: rgba(17,24,39,.9); }

/* Card body */
.dfc-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; flex: 1; }
.dfc-card-name { font-size: .9rem; font-weight: 600; line-height: 1.35; color: var(--dfc-ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.dfc-card-name:hover { color: #374151; }

/* Stars */
.dfc-stars { display: inline-flex; align-items: center; gap: 1px; font-size: .8rem; color: #d1d5db; }
.dfc-star.on { color: var(--dfc-star); }
.dfc-star-count { margin-left: 6px; font-size: .72rem; color: var(--dfc-muted); }

/* Price */
.dfc-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 2px; }
.dfc-now { font-weight: 800; color: var(--dfc-ink); }
.dfc-was { font-size: .82em; color: #9aa2ad; text-decoration: line-through; }
.dfc-price-lg .dfc-now { font-size: 1.6rem; }

/* Card Buy button (dark, like deepfix add-to-cart) */
.dfc-card-buy { margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 12px; border-radius: 9px; background: var(--dfc-ink); color: #fff; font-weight: 600; font-size: .82rem; text-decoration: none; transition: background .15s; }
.dfc-card-buy:hover { background: #374151; }

/* Category cards — mirror deepfix CategoryCard (contain image, name + count
   chip, description). Left-aligned like deepfix. */
.dfc-cat .dfc-card-img { background: #fff; }
.dfc-cat .dfc-card-img img { padding: 8px; object-fit: contain; }
.dfc-cat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dfc-cat .dfc-card-name { min-height: 0; }
.dfc-count-chip { flex-shrink: 0; border-radius: 999px; background: #eef1f4; color: #4b5563; font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; text-transform: uppercase; }
.dfc-cat-desc { margin: 2px 0 0; font-size: .78rem; color: var(--dfc-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Section subtitle (Choose from N subcategories / N products) */
.dfc-sub { margin: 2px 0 18px; color: var(--dfc-muted); font-size: .95rem; }

/* ---------------- Category bar (top nav, scrollable + arrows) ---------------- */
.dfc-catbar { position: relative; display: flex; align-items: stretch; background: var(--dfc-ink); color: #fff; }
.dfc-catbar-inner { flex: 1 1 auto; display: flex; align-items: stretch; gap: 2px; padding: 0 4px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.dfc-catbar-inner::-webkit-scrollbar { display: none; }
.dfc-cb-link { display: inline-flex; align-items: center; white-space: nowrap; color: #e5e7eb; text-decoration: none; padding: 12px 13px; font-size: .9rem; font-weight: 500; border-radius: 6px; }
.dfc-cb-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.dfc-cb-link.active { background: rgba(255,255,255,.16); color: #fff; }
.dfc-cb-all { font-weight: 600; }
/* Scroll arrows */
.dfc-cb-nav { flex: 0 0 auto; width: 40px; border: 0; background: var(--dfc-ink); color: #fff; cursor: pointer; font-size: 1.5rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.dfc-cb-nav:hover { background: #2b3442; }
.dfc-cb-nav[hidden] { display: none; }
.dfc-cb-prev { box-shadow: 8px 0 12px -6px rgba(0,0,0,.5); }
.dfc-cb-next { box-shadow: -8px 0 12px -6px rgba(0,0,0,.5); }
@media (max-width: 640px) { .dfc-cb-nav { display: none; } }  /* mobile: swipe to scroll */

/* Product detail */
.dfc-product { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 32px; margin-top: 8px; }
@media (max-width: 820px) { .dfc-product { grid-template-columns: 1fr; } }
.dfc-gallery > img { width: 100%; border: 1px solid var(--dfc-line); border-radius: var(--dfc-radius); background: var(--dfc-bg); object-fit: contain; aspect-ratio: 1/1; }
.dfc-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dfc-thumbs img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--dfc-line); border-radius: 8px; background: var(--dfc-bg); }
.dfc-info .dfc-stars { font-size: 1rem; margin: 8px 0; }
.dfc-price-lg { margin: 6px 0 10px; }
.dfc-stock { font-weight: 600; margin: 0 0 14px; }
.dfc-stock.in { color: #15803d; }
.dfc-stock.out { color: #b45309; }
.dfc-desc { margin: 12px 0 22px; line-height: 1.6; color: #374151; }
.dfc-buy { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 30px; background: var(--dfc-accent); color: #fff; font-weight: 700; text-decoration: none; border-radius: 11px; font-size: 1.02rem; transition: filter .15s, transform .15s; }
.dfc-buy:hover { filter: brightness(.94); transform: translateY(-1px); }
.dfc-note { font-size: .8rem; color: var(--dfc-muted); margin-top: 10px; }

/* Pager (chevrons in rounded buttons, dark active, windowed) */
.dfc-pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 30px 0 6px; }
.dfc-page { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #dfe4ea; border-radius: 10px; text-decoration: none; color: var(--dfc-ink); padding: 0 8px; font-weight: 600; background: #fff; transition: border-color .15s, background .15s; }
.dfc-page:hover { border-color: var(--dfc-ink); }
.dfc-page.cur { background: var(--dfc-ink); color: #fff; border-color: var(--dfc-ink); }
.dfc-arrow { border-radius: 50%; padding: 0; min-width: 40px; }
.dfc-page.is-disabled { opacity: .35; pointer-events: none; }
.dfc-ellipsis { min-width: 24px; height: 40px; display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; color: var(--dfc-muted); }

.dfc-empty { padding: 48px 0; color: var(--dfc-muted); text-align: center; }

/* ================= Cart / checkout / order (v1.3.0) ================= */
/* Add-to-cart button resets (now a real <button> inside a form) */
.dfc-atc-form { margin-top: 8px; }
button.dfc-card-buy, button.dfc-buy { border: 0; cursor: pointer; font: inherit; width: 100%; }
.dfc-card-buy.is-disabled, .dfc-buy.is-disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; text-align: center; }

/* "Added to cart" banner + error */
.dfc-added { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }
.dfc-added a { color: inherit; font-weight: 700; }
.dfc-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }

/* Cart link + badge in the category bar */
.dfc-cb-cart { position: relative; flex: 0 0 auto; display: flex; align-items: center; padding: 0 16px; color: #fff; text-decoration: none; font-size: 1.15rem; }
.dfc-cb-cart:hover { background: rgba(255,255,255,.12); }
.dfc-cart-badge { position: absolute; top: 6px; right: 8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--dfc-sale); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.dfc-cart-badge[hidden] { display: none; }

/* Cart page */
.dfc-cart { border: 1px solid var(--dfc-line); border-radius: var(--dfc-radius); overflow: hidden; }
.dfc-cart-row { display: grid; grid-template-columns: 64px 1fr 92px auto 32px; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--dfc-line); }
.dfc-cart-row:last-child { border-bottom: 0; }
.dfc-cart-img { width: 64px; height: 64px; background: var(--dfc-bg); border-radius: 8px; overflow: hidden; }
.dfc-cart-img img { width: 100%; height: 100%; object-fit: contain; }
.dfc-cart-name { font-weight: 600; color: var(--dfc-ink); text-decoration: none; }
.dfc-cart-price { font-size: .85rem; color: var(--dfc-muted); }
.dfc-cart-qty input { width: 64px; padding: 8px; border: 1px solid #d7dde3; border-radius: 8px; font: inherit; text-align: center; }
.dfc-cart-total { font-weight: 700; text-align: right; }
.dfc-cart-remove button { border: 0; background: transparent; color: var(--dfc-muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.dfc-cart-remove button:hover { color: #e11d48; }
@media (max-width: 560px) { .dfc-cart-row { grid-template-columns: 52px 1fr auto; grid-auto-rows: auto; } .dfc-cart-total { display: none; } }
.dfc-cart-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.dfc-cart-sub { font-size: 1.05rem; }
.dfc-cart-sub strong { font-size: 1.25rem; margin-left: 6px; }
.dfc-cart-note { display: block; font-size: .78rem; color: var(--dfc-muted); }
.dfc-buy.dfc-place, a.dfc-buy { text-decoration: none; }

/* Checkout */
.dfc-co-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 860px) { .dfc-co-grid { grid-template-columns: 1fr; } }
.dfc-co-h { margin: 4px 0 12px; font-size: 1.05rem; }
.dfc-co-fields label { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: 12px; }
.dfc-co-fields input, .dfc-co-fields select, .dfc-co-fields textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid #d7dde3; border-radius: 9px; font: inherit; font-weight: 400; }
.dfc-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .dfc-f2 { grid-template-columns: 1fr; } }
.dfc-pay { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; padding: 12px; border: 1px solid #d7dde3; border-radius: 10px; margin-bottom: 8px !important; cursor: pointer; }
.dfc-ep { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px 12px; border-radius: 9px; font-size: .85rem; margin: 4px 0 8px; }
.dfc-co-summary { background: #fff; border: 1px solid var(--dfc-line); border-radius: var(--dfc-radius); padding: 18px; position: sticky; top: 16px; }
.dfc-co-items { list-style: none; margin: 0 0 12px; padding: 0; }
.dfc-co-items li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--dfc-line); font-size: .88rem; }
.dfc-co-items .q { color: var(--dfc-muted); font-weight: 700; }
.dfc-co-items .n { flex: 1; }
.dfc-co-items .t { font-weight: 700; }
.dfc-co-sub { display: flex; justify-content: space-between; font-size: .9rem; padding: 4px 0; }
.dfc-co-total { font-size: 1.05rem; border-top: 1px solid var(--dfc-line); margin-top: 6px; padding-top: 8px; }
.dfc-place { margin-top: 14px; padding: 14px; font-size: 1rem; }

/* Thank you */
.dfc-thankyou { max-width: 620px; margin: 0 auto; text-align: center; padding: 20px 0 40px; }
.dfc-ty-check { width: 68px; height: 68px; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.dfc-ty-card { text-align: left; background: #fff; border: 1px solid var(--dfc-line); border-radius: var(--dfc-radius); padding: 18px; margin: 20px 0; }
.dfc-thankyou .dfc-buy { display: inline-flex; margin-top: 8px; }

/* Thank-you WhatsApp + continue buttons (v1.3.2) */
.dfc-thankyou .dfc-buy { display: inline-flex; margin: 8px 6px 0; }
.dfc-wa { background: #25D366 !important; color: #fff !important; }
.dfc-wa:hover { filter: brightness(.95); }
.dfc-ghost { background: transparent !important; color: var(--dfc-ink) !important; border: 1px solid #d7dde3; }
.dfc-ghost:hover { background: #f3f4f6 !important; }
