/*
Theme Name: MoParts.in
Theme URI: https://MoParts.in
Author: Avnish
Author URI: https://example.com
Description: A custom WordPress theme
Version: 1.0
*/

:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --muted: #64748B;
  --text: #0F172A;
  --accent: #94A3B8;
  --accent-2: #475569;
  --logo: #f40404;
  --accent-strong: #1E293B;
  --accent-light: #E2E8F0;
  --field: #F1F5F9;
  --border: #E2E8F0;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 160px;
}

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

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.logo { display: flex; align-items: center; }
.logo a { color: var(--logo); font-weight: 800; font-size: 22px; text-decoration: none; letter-spacing: 0.5px; }
.logo img { display: none; }
.brand-tabs {
  display: flex;
  gap: 8px;
}
.brand-tabs a {
  text-decoration: none;
}
.tab {
  background: var(--field);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.tab.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 2px 6px;
  background: var(--accent-2);
  color: #052e1d;
  border-radius: 999px;
  font-weight: 700;
  margin-left: 6px;
}
.header__search {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 12px;
}
.header__search input {
  width: min(520px, 100%);
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.header__menu {
  display: flex;
  gap: 8px;
}

.hero {
  padding: 28px 0 8px 0;
}
.hero--split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
  align-items: center;
}
@media (max-width: 800px) {
  .hero--split { grid-template-columns: 1fr; }
}
.feeds-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 800px) {
  .feeds-split { grid-template-columns: 1fr; }
}
.hero h1 {
  margin: 0 0 8px 0;
  font-size: 32px;
}
.hero p {
  margin: 0;
  color: var(--muted);
}

.filters__row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 900px) {
  .filters__row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .filters__row { grid-template-columns: 1fr; }
}

.banner {
  position: relative;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.banner img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  filter: saturate(1.1) contrast(1.05) brightness(0.95);
}
.banner__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}
.banner__nav.prev { left: 8px; }
.banner__nav.next { right: 8px; }
.banner__dots {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.banner__dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.banner__dots .dot.active { background: #fff; }
.banner__tagline {
  position: absolute;
  bottom: 10px;
  left: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35));
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.filters {
  margin: 18px 0 8px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.filters__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}
@media (min-width: 720px) {
  .filters__row {
    grid-template-columns: 1fr 1fr 0.8fr;
  }
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input[type="text"],
.field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.field input[type="range"] {
  width: 100%;
}
.price-display {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.brand-bar {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.brand-bar .tab { border-color: var(--border); }

.results__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  color: var(--muted);
}
main.container { padding-bottom: 120px; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}
.grid--three {
  grid-template-columns: 1fr 1fr 1fr;
}
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.1); }
.card__img {
  height: 140px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-weight: 700;
  letter-spacing: 1px;
}
.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card__body { padding: 12px; }
.pill {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: rgba(130,142,132,0.12);
  border: 1px solid rgba(130,142,132,0.35);
  border-radius: 999px;
  padding: 4px 8px;
  margin-right: 6px;
}
.pill_product a{
    display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: rgba(130,142,132,0.12);
  border: 1px solid rgba(130,142,132,0.35);
  border-radius: 999px;
  padding: 4px 8px;
  margin-right: 6px;
}
.card__title {
  margin: 8px 0 6px 0;
  font-weight: 600;
}
.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}
.price {
  color: var(--accent);
  font-weight: 700;
}
.price,
.woocommerce div.product p.price {
  font-size: 22px;
}

.btn,
.single_add_to_cart_button {
  background: #4f46e5;
  color: #fff;
}

.meta-row div {
  margin-bottom: 6px;
}
.quantity input {
  width: 60px;
}

.btn {
  display: inline-block;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
a.btn {
  display: inline-block;
  border: none;
  text-decoration: none;
  font-size: 13px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.btn:hover { background: var(--accent-strong); }
.btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--field);
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 18px 0 42px 0;
}
.pagination button {
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}
.pagination .active {
  background: var(--accent);
  border-color: transparent;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
}
.modal.show { display: block; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92%, 760px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.modal__close {
  position: absolute;
  right: 8px;
  top: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}
.modal__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 760px) {
  .modal__grid { grid-template-columns: 1fr 1.3fr; }
}
.modal__img {
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 280px;
}
.modal__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.thumbs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.85;
}
.thumbs img.active {
  outline: 2px solid var(--accent);
  opacity: 1;
}
.modal__details h2 {
  margin: 0 0 4px 0;
}
.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.meta-row div {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  background: var(--card);
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

/* Simple horizontal carousels */
.carousel {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 22px;
}
.carousel__item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 8px;
  cursor: pointer;
}
.carousel__item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.carousel__title {
  font-size: 13px;
  margin: 6px 0 4px 0;
}
.carousel__price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}
.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.carousel__nav.prev { left: 6px; }
.carousel__nav.next { right: 6px; }
.carousel__dots {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.carousel__dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa3c7;
}
.carousel__dots .dot.active { background: #2563eb; }

/* Sale ticker */
.ticker {
  white-space: nowrap;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 8px 12px;
}
.ticker__inner {
  display: inline-flex;
  gap: 24px;
  animation: tickerScroll 20s linear infinite;
}
.ticker__item { color: var(--muted); }
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.feeds-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .feeds-grid { grid-template-columns: 1fr 1fr; }
}
.cart-item {
  background: #111;
  padding: 10px;
  border-radius: 8px;
}

.cart-price,
.woocommerce-cart .price {
  font-size: 20px;
}

.remove {
  font-size: 22px;
  color: #ef4444;
}
.woocommerce-checkout .form-row input,
.woocommerce-checkout .form-row select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

#place_order,
.woocommerce button.button.alt {
  background: #4f46e5;
  border-radius: 8px;
  padding: 12px 18px;
}

.woocommerce-checkout-review-order-table {
  margin-top: 10px;
}

.single_add_to_cart_button {
  background: #4f46e5;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
}

.qty-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  animation: fadeScale .25s ease;
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

/* === FIX ADD TO CART ALIGNMENT === */

.single-product form.cart {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

/* Quantity box */
.single-product .quantity {
  margin: 0;
}

.single-product .quantity input.qty {
  width: 64px;
  height: 44px;
  line-height: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  text-align: center;
}

/* Add to cart button */
.single-product .single_add_to_cart_button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  border: none;
  white-space: nowrap;
}

/* Back button alignment */
.single-product .btn.secondary {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Ensure everything stays in one line */
.single-product .modal__details > div:last-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-product .price {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.single-product .price del {
  color: #9ca3af;
  font-size: 18px;
}

.single-product .price ins {
  text-decoration: none;
  color: #4f46e5;
  font-weight: 700;
}
.single-product .meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.single-product .meta-row > div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
}
.single-product .woocommerce-product-details__short-description,
.single-product .product-description {
  color: #6b7280;
  line-height: 1.6;
  margin: 12px 0 16px;
}
.single-product form.cart {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.single-product .quantity input.qty {
  width: 64px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-size: 16px;
}

.single-product .single_add_to_cart_button {
  background: #4f46e5;
  color: #fff;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  border: none;
}

.single-product .single_add_to_cart_button:hover {
  background: #4338ca;
}
.single-product .modal__img img {
  border-radius: 12px;
}

.single-product .thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.single-product .thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.single-product .thumbs img.active,
.single-product .thumbs img:hover {
  border-color: #4f46e5;
}
.single-product .modal__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .single-product .modal__grid {
    grid-template-columns: 1fr;
  }
}
.single-product .product-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sticky-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 10px 16px;
  display: none;
  z-index: 999;
}

.sticky-cart-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sticky-cart-bar .single_add_to_cart_button {
  height: 44px;
}

.cart-count.bump {
  animation: bump 0.3s ease;
}
@keyframes bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@media (max-width: 768px) {

  .single-product .modal__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .single-product .product-actions,
  .single-product form.cart {
    flex-direction: column;
    align-items: stretch;
  }

  .single-product .single_add_to_cart_button,
  .single-product .btn.secondary {
    width: 100%;
  }

  .sticky-cart-bar {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
.single-product .product_title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
}
.single-product .price ins {
  font-size: 26px;
  color: #2563eb;
}
.related-products .card {
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.single_add_to_cart_button {
  background: linear-gradient(90deg,#ff9f00,#fb641b);
}
.single-product .product-description,
.single-product .product-short-description {
  color: #6b7280;
  line-height: 1.6;
  font-size: 15px;
  margin: 12px 0;
}

.single-product .woocommerce-tabs {
  margin-top: 30px;
}
.product-main-img {
  transition: opacity 0.25s ease;
}

.thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumbs img.active,
.thumbs img:hover {
  border-color: #4f46e5;
}

