/* ============================================
   Thiruchendur Murugan Vedikadai - Shared Styles
   ============================================ */

/* --- CSS Variables (Color Palette) --- */
:root {
  --primary: #8b0000;
  --primary-dark: #6a0000;
  --accent: #d4a017;
  --accent-light: #ffd966;
  --success: #28a745;
  --success-dark: #1e7e34;
  --danger: #dc3545;
  --danger-dark: #c82333;
  --info: #0057ff;
  --bg-warm: #fff7e6;
  --bg-card: #ffffff;
  --text-dark: #222;
  --text-muted: #666;
  --text-light: #fff;
  --border: #ddd;
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 60px;
}

/* --- Reset & Base --- */
/* Rupee sign — ASCII \\20B9 escape (safe on upload) */
.inr::before {
  content: "\20B9 ";
  font-weight: 700;
}

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

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-warm);
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--info);
  text-decoration: none;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Navigation --- */
.site-nav {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  min-height: var(--nav-height);
  gap: 12px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}

.nav-brand img {
  width: 44px;
  height: 52px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.nav-brand-en {
  font-size: clamp(0.95rem, 2.8vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nav-brand-ta {
  font-size: clamp(0.8rem, 2.2vw, 0.95rem);
  opacity: 0.95;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.nav-link--cart {
  background: var(--info);
  border-radius: 20px;
  padding: 8px 18px;
}

.nav-link--cart:hover {
  background: #004ad6;
}

.nav-link--admin {
  background: rgba(255,255,255,0.1);
}

.cart-badge {
  background: var(--accent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* --- Hero / Header Banner (top_image.png) --- */
.hero--banner {
  padding: 0;
  background: var(--primary-dark);
}

.hero-banner {
  position: relative;
  width: 100%;
  max-height: 420px;
  min-height: 260px;
  overflow: hidden;
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: clamp(260px, 42vw, 420px);
  object-fit: cover;
  object-position: center 35%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 28px 20px 32px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(106, 0, 0, 0.88) 100%
  );
}

.hero-title-en {
  margin: 0 0 6px;
  font-size: clamp(1.65rem, 5vw, 2.85rem);
  font-weight: 800;
  color: var(--accent-light);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.hero-title-ta {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 3.8vw, 2rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  line-height: 1.2;
}

.hero-tagline {
  margin: 0 0 18px;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 720px;
}

.hero-contact a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 214, 102, 0.55);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  flex: 1 1 220px;
  max-width: 340px;
}

.hero-contact a:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.hero-contact-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  opacity: 0.95;
}

.hero-contact-value {
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
}

.hero-phone .hero-contact-value {
  font-size: clamp(1.35rem, 3.8vw, 1.75rem);
  letter-spacing: 0.02em;
}

.hero-email .hero-contact-value {
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 700;
}

/* --- Announcement Bar (replaces marquee) --- */
.announce-bar {
  background: var(--text-dark);
  color: var(--accent);
  text-align: center;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* --- Main Content Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* --- Product Card Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.product-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 2px;
}

.product-card-name-ta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.product-card-prices {
  background: #fff8ec;
  border: 2px solid var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: center;
}

.price-old {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-offer {
  display: inline-block;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.price-new {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--success);
  margin-top: 6px;
  letter-spacing: -0.5px;
}

.product-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.qty-input {
  width: 60px;
  padding: 8px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* --- Quantity Stepper (product card) --- */
.qty-stepper {
  margin-top: auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

.qty-stepper .qty-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 2px solid var(--primary);
  background: var(--primary);
  color: var(--text-light);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
  padding: 0;
  line-height: 1;
}

.qty-stepper .qty-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.qty-stepper .qty-btn:active {
  transform: scale(0.94);
}

.qty-stepper .qty-minus {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.qty-stepper .qty-plus {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.qty-stepper .product-qty {
  width: 64px;
  flex: 0 0 64px;
  height: 40px;
  border: 2px solid var(--primary);
  border-left: none;
  border-right: none;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: 0;
  -moz-appearance: textfield;
  padding: 0;
}

.qty-stepper .product-qty::-webkit-outer-spin-button,
.qty-stepper .product-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.product-card-subtotal {
  text-align: center;
  margin-top: 8px;
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.product-card-subtotal strong {
  color: var(--success);
}

.product-card.is-active {
  box-shadow: 0 0 0 2px var(--success), var(--shadow);
}

/* --- Sticky Total Bars (Top & Bottom) --- */
.total-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-light);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 900;
}

.total-bar--top {
  position: sticky;
  top: var(--nav-height);
}

.total-bar--bottom {
  position: sticky;
  bottom: 0;
}

.total-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.total-bar-items,
.total-bar-amount {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.total-bar-items strong {
  color: var(--accent-light);
  font-size: 1.05rem;
}

.total-bar-amount strong {
  color: var(--accent-light);
  font-size: 1.15rem;
}

.total-bar-btn {
  padding: 8px 20px;
  font-size: 0.95rem;
  min-width: 130px;
}

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

/* --- Site Footer --- */
.site-footer {
  background: var(--text-dark);
  color: #ddd;
  margin-top: 40px;
  padding: 36px 16px 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h3 {
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0 0 12px;
  font-weight: 700;
}

.footer-col p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-col a {
  color: #ddd;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--accent-light);
}

.footer-ta {
  color: var(--accent-light);
  font-size: 0.95rem !important;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 0.9rem;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #999;
}

.footer-bottom p {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn--primary {
  background: linear-gradient(135deg, #2ecc40, var(--success));
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  box-shadow: 0 4px 14px rgba(40, 167, 69, 0.4);
  transform: translateY(-1px);
}

.btn--danger {
  background: var(--danger);
  color: white;
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger-dark);
}

.btn--info {
  background: var(--info);
  color: white;
}

.btn--info:hover:not(:disabled) {
  background: #004ad6;
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn--outline:hover {
  background: var(--primary);
  color: white;
}

.btn--accent {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
}

.btn--accent:hover {
  background: linear-gradient(135deg, #ff5722, #e65100);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1.1rem;
}

.btn--add-to-cart {
  flex: 1;
}

/* --- Toast Notification --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--success);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  max-width: 320px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h2 {
  font-size: 1.3rem;
  color: var(--text-dark);
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 20px;
}

/* --- Cart Page --- */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
  border-left: 4px solid transparent;
}

.cart-item:hover {
  box-shadow: var(--shadow-lg);
  border-left-color: var(--success);
  transform: translateX(2px);
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

.cart-item-name {
  font-weight: 600;
}

.cart-item-price {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--border);
}

.cart-item-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--success);
  white-space: nowrap;
}

.cart-summary {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 20px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 12px 0;
  border-top: 2px solid var(--border);
}

.cart-total-amount {
  color: var(--success);
  font-size: 1.5rem;
}

/* --- Checkout Form --- */
.checkout-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 24px;
}

.checkout-section h2 {
  text-align: center;
  color: var(--primary);
  margin: 0 0 20px;
  font-size: 1.3rem;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.2);
}

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

/* --- Order Confirmation --- */
.order-success {
  text-align: center;
  padding: 40px 20px;
}

.order-success-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.order-success h2 {
  color: var(--success);
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.order-success .order-number {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.order-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  text-align: left;
}

.order-summary-table th {
  background: var(--primary);
  color: white;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.order-summary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.payment-qr-block {
  background: #fff8ec;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px auto;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.payment-qr-block h3 {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 1.1rem;
}

.payment-qr-img {
  width: 240px;
  height: 240px;
  max-width: 100%;
  object-fit: contain;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
}

.payment-qr-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.order-delivery-info {
  background: #f0f9f0;
  border: 2px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 20px 0;
  text-align: left;
}

.order-delivery-info h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--success);
}

/* --- Admin Nav --- */
.admin-nav {
  background: var(--primary);
  padding: 0 16px;
}

.admin-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  gap: 12px;
  flex-wrap: wrap;
}

.admin-nav-title {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
}

.admin-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Admin Form --- */
.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px;
}

.admin-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-card h2 {
  color: var(--primary);
  margin: 0 0 20px;
  font-size: 1.3rem;
  text-align: center;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- Admin Product List --- */
.admin-product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-product-item {
  display: grid;
  grid-template-columns: 70px 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.admin-product-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent-light);
}

.admin-product-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
}

.admin-product-info {
  min-width: 0;
}

.admin-product-info strong {
  display: block;
  font-size: 0.95rem;
}

.admin-product-info small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.admin-product-price {
  text-align: center;
  white-space: nowrap;
}

/* --- Admin Orders --- */
.order-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.order-card-id {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.order-card-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.order-customer-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.order-customer-info div {
  padding: 4px 0;
}

.order-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.order-items-table th {
  background: var(--primary);
  color: white;
  padding: 10px 8px;
  text-align: left;
  font-size: 0.85rem;
}

.order-items-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.order-items-table img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.order-total {
  text-align: right;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--success);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--primary) 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-warm);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 3px solid var(--accent);
}

.login-card h1 {
  font-size: 1.5rem;
  color: var(--primary);
  margin: 0 0 4px;
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.login-card h2 {
  font-size: 1.6rem;
  color: var(--danger);
  margin: 0 0 16px;
}

.login-error {
  background: #fde8e8;
  color: var(--danger);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* --- Flash Banners (success / error / info) --- */
.flash-banner {
  max-width: 880px;
  margin: 0 auto 16px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 5px solid;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: flash-in 0.25s ease-out;
}

/* Top-of-page banners stick to the top so users can't miss them */
main.container > .flash-banner {
  position: sticky;
  top: calc(var(--nav-height) + 8px);
  z-index: 800;
  max-width: 100%;
}

.flash-banner::before {
  font-size: 1.2rem;
  line-height: 1;
}

.flash-success {
  background: #e8f7ee;
  color: var(--success-dark);
  border-left-color: var(--success);
}
.flash-success::before { content: "\2714"; }

.flash-error {
  background: #fde8e8;
  color: var(--danger-dark);
  border-left-color: var(--danger);
}
.flash-error::before { content: "\26A0"; }

.flash-info {
  background: #e8f1ff;
  color: #0040b3;
  border-left-color: var(--info);
}
.flash-info::before { content: "\2139"; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Form hint text --- */
.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Search / Filter Bar --- */
.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 24px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.2);
}

.search-input::placeholder {
  color: #999;
}

.product-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- View Toggle (List / Grid) --- */
.view-toggle {
  display: inline-flex;
  border: 2px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-card);
}

.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-toggle-btn + .view-toggle-btn {
  border-left: 1px solid var(--border);
}

.view-toggle-btn:hover {
  color: var(--primary);
}

.view-toggle-btn.is-active {
  background: var(--primary);
  color: var(--text-light);
}

/* --- Grid View --- */
.product-grid.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.product-grid.view-grid .product-card {
  flex-direction: column;
  position: static;
  padding: 0;
}

.product-grid.view-grid .product-card:hover {
  transform: translateY(-3px);
}

.product-grid.view-grid .product-card-img {
  width: 100%;
  height: 200px;
  flex: none;
  border-radius: 0;
}

.product-grid.view-grid .product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  grid-template-rows: unset;
}

.product-grid.view-grid .product-card-name,
.product-grid.view-grid .product-card-name-ta,
.product-grid.view-grid .product-card-prices,
.product-grid.view-grid .qty-stepper {
  grid-column: unset;
  grid-row: unset;
}

.product-grid.view-grid .product-card-name {
  font-size: 1.05rem;
  margin: 0 0 2px;
}

.product-grid.view-grid .product-card-name-ta {
  margin: 0 0 12px;
}

.product-grid.view-grid .product-card-prices {
  text-align: center;
  min-width: 0;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.product-grid.view-grid .price-new {
  font-size: 1.5rem;
}

.product-grid.view-grid .qty-stepper {
  padding-top: 12px;
  border-top: 1px solid #eee;
  margin-top: auto;
}

.product-grid.view-grid .product-card-subtotal {
  display: block;
  position: static;
  margin-top: 8px;
  font-size: 0.9rem;
}

/* --- List View (default) --- */
.product-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.product-grid.view-list .product-card {
  flex-direction: row;
  align-items: stretch;
  padding: 10px;
  gap: 14px;
}

.product-grid.view-list .product-card:hover {
  transform: none;
}

.product-grid.view-list .product-card-img {
  width: 110px;
  height: 110px;
  flex: 0 0 110px;
  border-radius: var(--radius-sm);
  align-self: center;
}

.product-grid.view-list .product-card-body {
  padding: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 4px;
}

.product-grid.view-list .product-card-name {
  grid-column: 1;
  grid-row: 1;
  font-size: 1.1rem;
  margin: 0;
  align-self: end;
}

.product-grid.view-list .product-card-name-ta {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  align-self: start;
}

.product-grid.view-list .product-card-prices {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
  padding: 8px 14px;
  text-align: center;
  min-width: 140px;
  align-self: center;
}

.product-grid.view-list .price-old { font-size: 0.8rem; }
.product-grid.view-list .price-offer { font-size: 0.65rem; padding: 1px 6px; }
.product-grid.view-list .price-new {
  font-size: 1.25rem;
  margin-top: 2px;
}

.product-grid.view-list .qty-stepper {
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 0;
  border-top: none;
  margin: 0;
  align-self: center;
}

.product-grid.view-list .product-card-subtotal {
  display: none;
}

.product-grid.view-list .product-card.is-active .product-card-subtotal {
  display: block;
  position: absolute;
  bottom: 6px;
  right: 14px;
  font-size: 0.8rem;
  margin: 0;
}

.product-grid.view-list .product-card {
  position: relative;
}

@media (max-width: 768px) {
  .product-grid.view-list .product-card {
    padding: 8px;
    gap: 10px;
  }
  .product-grid.view-list .product-card-img {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
  }
  .product-grid.view-list .product-card-body {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    row-gap: 6px;
  }
  .product-grid.view-list .product-card-name {
    font-size: 0.95rem;
  }
  .product-grid.view-list .product-card-name-ta {
    font-size: 0.78rem;
  }
  .product-grid.view-list .product-card-prices {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
    padding: 6px 10px;
    min-width: 0;
  }
  .product-grid.view-list .price-new { font-size: 1.05rem; }
  .product-grid.view-list .qty-stepper {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
  }
  .product-grid.view-list .product-card.is-active .product-card-subtotal {
    position: static;
    text-align: right;
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
  .hero-overlay {
    padding: 20px 14px 24px;
  }

  .hero-contact {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-contact a {
    max-width: none;
    padding: 10px 16px;
  }

  .hero h1 { font-size: 1.1rem; }
  .hero-logo { width: 50px; height: 60px; }

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

  .product-grid.view-grid .product-card-img {
    height: 150px;
  }

  .total-bar-inner {
    padding: 8px 12px;
    gap: 8px;
  }

  .total-bar-items,
  .total-bar-amount {
    font-size: 0.85rem;
  }

  .total-bar-items strong { font-size: 0.95rem; }
  .total-bar-amount strong { font-size: 1rem; }

  .total-bar-btn {
    padding: 7px 14px;
    font-size: 0.85rem;
    min-width: auto;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 10px;
  }

  .cart-item-qty,
  .cart-item-total,
  .cart-item .btn--danger {
    grid-column: 2;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-product-item {
    grid-template-columns: 60px 1fr;
    gap: 8px;
  }

  .admin-product-price,
  .admin-product-item .btn--danger {
    grid-column: 2;
  }

  .order-customer-info {
    grid-template-columns: 1fr;
  }

  .admin-nav-inner {
    flex-direction: column;
    padding: 12px 16px;
    gap: 8px;
  }

  .admin-nav-links {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .nav-inner {
    padding: 0 10px;
  }

  .nav-brand-text {
    font-size: 0.9rem;
  }

  .nav-brand-ta {
    display: none;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .hero-banner-img {
    height: 200px;
  }

  .hero-overlay {
    padding: 16px 10px 20px;
  }

  .hero h1 { font-size: 1rem; }
  .hero-subtitle { font-size: 0.8rem; }
  .hero-logo { width: 44px; height: 52px; }

  .nav-brand-en { font-size: 0.8rem; }
  .nav-brand-ta { display: none; }

  .container { padding: 12px 10px; }

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

  .product-grid.view-grid .product-card-img {
    height: 130px;
  }

  .product-card-body { padding: 10px; }
  .product-card-img { height: 130px; }

  .product-card-name { font-size: 0.95rem; }
  .product-card-name-ta { font-size: 0.78rem; margin-bottom: 8px; }

  .product-card-prices {
    padding: 8px;
    margin-bottom: 10px;
  }

  .price-new { font-size: 1.15rem; }
  .price-old { font-size: 0.75rem; }
  .price-offer { font-size: 0.65rem; padding: 1px 6px; }

  .qty-stepper {
    padding-top: 8px;
  }

  .qty-stepper .qty-btn {
    width: 34px;
    height: 36px;
    flex: 0 0 34px;
    font-size: 1.1rem;
  }

  .qty-stepper .product-qty {
    width: 48px;
    flex: 0 0 48px;
    height: 36px;
    font-size: 0.95rem;
  }

  .product-card-subtotal { font-size: 0.8rem; }

  .product-card-actions {
    flex-direction: column;
  }

  .product-card-actions .qty-input {
    width: 100%;
  }

  .product-card-actions .btn {
    width: 100%;
  }

  .total-bar-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .site-footer {
    padding: 28px 14px 0;
    margin-top: 24px;
  }

  .cart-item {
    grid-template-columns: 50px 1fr;
  }

  .cart-item-img {
    width: 50px;
    height: 50px;
  }

  .checkout-section { padding: 16px; }

  .btn--lg {
    padding: 12px 20px;
    font-size: 1rem;
  }

  .order-card { padding: 14px; }

  .order-items-table {
    font-size: 0.8rem;
  }

  .order-items-table img {
    width: 40px;
    height: 40px;
  }

  .login-card { padding: 24px 20px; }

  .admin-product-item {
    grid-template-columns: 50px 1fr;
  }

  .admin-product-thumb {
    width: 50px;
    height: 50px;
  }
}

/* --- 3-Step Checkout Wizard (cart_checkout.php) --- */
.checkout-wizard {
  max-width: 900px;
  margin: 0 auto;
}

.checkout-steps-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.checkout-step-pill {
  padding: 8px 18px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: #eee;
  transition: background 0.2s, color 0.2s;
}

.checkout-step-pill.is-active {
  background: var(--primary);
  color: var(--text-light);
}

.checkout-step-pill.is-done {
  background: var(--success);
  color: var(--text-light);
}

.checkout-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.checkout-panel.is-hidden {
  display: none;
}

.checkout-panel-title {
  text-align: center;
  font-size: 1.2rem;
  color: var(--primary);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-warm);
  font-weight: 700;
}

.checkout-table-wrap {
  overflow-x: auto;
}

.checkout-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.95rem;
}

.checkout-table th {
  background: var(--primary);
  color: var(--text-light);
  padding: 10px 12px;
  text-align: left;
}

.checkout-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.checkout-table-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f0f0f0;
}

.checkout-grand-total {
  text-align: right;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 2px solid var(--bg-warm);
}

.checkout-pay-box {
  background: var(--bg-warm);
  border: 2px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.checkout-pay-amount {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  margin: 8px 0 16px;
}

.checkout-upi-id {
  background: #fff;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-all;
  margin: 12px 0;
}

.checkout-qr-img {
  width: 220px;
  max-width: 90%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: #fff;
  margin: 12px auto;
  display: block;
}

.checkout-pay-phone {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 12px 0;
}

.checkout-info-note {
  background: #fff8ec;
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: left;
  margin: 14px 0;
  color: var(--text-dark);
}

.checkout-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.checkout-actions-row .btn {
  flex: 1;
  min-width: 120px;
}

.checkout-success {
  text-align: center;
  padding: 32px 16px;
}

.checkout-success-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .checkout-step-pill {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  .checkout-table { min-width: 400px; font-size: 0.85rem; }
}
