/* Kerala Sale — base styles v4 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manjari:wght@400;700&display=swap');

:root {
  --color-terracotta: #993C1D;
  --color-terracotta-dark: #4A1B0C;
  --color-terracotta-light: #FAECE7;
  --color-coral: #D85A30;
  --color-leaf: #639922;
  --color-leaf-dark: #173404;
  --color-leaf-light: #EAF3DE;
  --color-turmeric: #FAC775;
  --color-turmeric-dark: #412402;
  --color-bg: #FFFFFF;
  --color-bg-muted: #F1EFE8;
  --color-text: #2C2C2A;
  --color-text-muted: #5F5E5A;
  --color-border: #D3D1C7;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ml: 'Manjari', 'Noto Sans Malayalam', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container: 1100px;
}

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

body {
  margin: 0;
  font-family: var(--font-en);
  color: var(--color-text);
  background: var(--color-bg-muted);
  line-height: 1.45;
  font-size: 14px;
}

.ml-text {
  font-family: var(--font-ml);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.9;
}

button {
  font-family: var(--font-en);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

input, select, textarea {
  font-family: var(--font-en);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
}

input.ml-input, textarea.ml-input {
  font-family: var(--font-ml);
  font-size: 15px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.page-main {
  padding-top: 16px;
  padding-bottom: 32px;
}

/* ---- Header ---- */
.header {
  background: var(--color-terracotta);
  color: var(--color-terracotta-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.header-wrap {
  padding-top: 10px;
  padding-bottom: 10px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--color-terracotta-light);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.lang-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.lang-switch {
  opacity: 0.8;
  padding: 2px 4px;
}

.lang-switch.active {
  opacity: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lang-divider {
  opacity: 0.45;
  font-size: 12px;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
}

.nav-links a {
  padding: 5px 10px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.header-search {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.header-search input {
  width: 100%;
  border: none;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
}

.header-search input::placeholder {
  color: var(--color-text-muted);
}

.header-search input:focus {
  outline: 2px solid var(--color-turmeric);
  outline-offset: 1px;
}

/* ---- Buttons ---- */
.btn-primary {
  background: var(--color-terracotta);
  color: var(--color-terracotta-light);
  border: none;
  padding: 9px 18px;
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
  text-align: center;
}

.btn-secondary {
  background: var(--color-leaf);
  color: #fff;
  border: none;
  padding: 9px 18px;
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}

.btn-outline {
  background: var(--color-bg);
  color: var(--color-text);
  border: 0.5px solid var(--color-border);
  padding: 9px 18px;
  font-weight: 500;
  display: block;
  text-align: center;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Cards ---- */
.card {
  background: var(--color-bg);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.badge-free {
  background: var(--color-leaf-light);
  color: var(--color-leaf-dark);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
}

.price {
  color: var(--color-terracotta);
  font-weight: 600;
}

/* ---- Category pills ---- */
.category-pills {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 0.5px solid var(--color-border);
  border-radius: 20px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pill:hover {
  border-color: var(--color-terracotta);
  color: var(--color-terracotta-dark);
}

.pill-active {
  background: var(--color-terracotta-light);
  border-color: var(--color-terracotta);
  color: var(--color-terracotta-dark);
}

/* ---- Promo banner ---- */
.banner-free {
  background: var(--color-leaf-light);
  border: 0.5px solid rgba(99, 153, 34, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.banner-title {
  margin: 0 0 4px;
  color: var(--color-leaf-dark);
  font-weight: 600;
  font-size: 15px;
}

.banner-sub {
  margin: 0;
  color: var(--color-leaf-dark);
  font-size: 13px;
  opacity: 0.9;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

/* ---- Product grid ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.product-card {
  display: block;
  transition: box-shadow 0.15s, transform 0.15s;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.product-thumb {
  height: 120px;
  background: var(--color-turmeric) center/cover no-repeat;
}

.product-body {
  padding: 10px 12px;
}

.product-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

.product-price {
  font-size: 14px;
  margin: 0;
}

.empty-state {
  color: var(--color-text-muted);
  font-size: 14px;
  grid-column: 1 / -1;
  padding: 8px 0;
}

/* ---- Auth ---- */
.auth-page {
  padding-top: 24px;
  padding-bottom: 36px;
  max-width: 420px;
}

.auth-card {
  padding: 24px;
}

.auth-title {
  font-size: 18px;
  margin: 0 0 4px;
}

.auth-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0;
}

.field-label {
  font-size: 12px;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 4px;
}

.field-input {
  width: 100%;
}

.field-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 4px 0 0;
  min-height: 16px;
}

.optional {
  font-weight: 400;
  opacity: 0.7;
}

.alert-error {
  background: #FCEBEB;
  color: #791F1F;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-info {
  background: var(--color-turmeric);
  color: var(--color-turmeric-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-footer-link {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 14px;
  text-align: center;
}

.auth-footer-link a {
  text-decoration: underline;
  color: var(--color-terracotta);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--color-border);
}

.divider span {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.otp-input {
  letter-spacing: 4px;
}

.link-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.hidden {
  display: none !important;
}

/* ---- Product detail ---- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.product-gallery-main {
  height: 280px;
  background: var(--color-turmeric) center/cover no-repeat;
  border-radius: var(--radius-md);
}

.product-info h1 {
  font-size: 22px;
  margin: 0 0 10px;
}

.product-info .detail-price {
  font-size: 24px;
  margin: 0 0 14px;
}

.detail-row {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

.detail-desc {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.6;
}

/* ---- Seller forms ---- */
.form-page {
  max-width: 780px;
}

.form-header {
  background: var(--color-terracotta);
  color: var(--color-terracotta-light);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-body {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.listing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.listing-table th, .listing-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--color-border);
}

.status-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-leaf-light);
  color: var(--color-leaf-dark);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.plan-card {
  padding: 18px;
  text-align: center;
}

.plan-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.plan-price {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-terracotta);
  margin: 0 0 10px;
}

.plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.plan-current {
  border-color: var(--color-leaf);
  box-shadow: 0 0 0 2px var(--color-leaf-light);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-bg);
  border-top: 0.5px solid var(--color-border);
  margin-top: 32px;
  padding: 18px 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-nav a:hover {
  color: var(--color-terracotta);
  opacity: 1;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-nav {
    justify-content: space-between;
    width: 100%;
  }

  .nav-links {
    gap: 0;
  }

  .nav-links a {
    padding: 5px 8px;
    font-size: 12px;
  }

  .brand {
    font-size: 18px;
  }

  .banner-free {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .banner-free .btn-secondary {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-thumb {
    height: 100px;
  }

  .form-grid, .product-detail, .form-row-2 {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-nav {
    justify-content: center;
  }
}

@media (min-width: 641px) {
  .header-search {
    max-width: 100%;
  }
}