/* store/assets/css/store.css */
/* Premium styling extension for Mitti Gold Farmer Store & Classifieds */

/* Layout Variables (Matching parent theme but with local overrides) */
:root {
  --store-green: #2d7a1f;
  --store-green-dark: #1f5814;
  --store-green-light: #eaf5e8;
  --store-gold: #f5a623;
  --store-gold-dark: #d48b16;
  --store-gold-light: #fef6e7;
  --store-dark: #1a1a1a;
  --store-white: #ffffff;
  --store-gray-light: #f8f9fa;
  --store-gray: #e9ecef;
  --store-gray-dark: #6c757d;
  --store-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --store-shadow-md: 0 4px 24px rgba(45, 122, 31, 0.08);
  --store-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --store-radius: 12px;
  --store-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Wrapper for Store Pages */
.store-wrapper {
  padding: 60px 0;
  background-color: var(--store-gray-light);
  min-height: 70vh;
}

/* Page Header Title */
.store-title-section {
  text-align: center;
  margin-bottom: 45px;
}
.store-title-section h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  color: var(--store-green-dark);
  margin-bottom: 12px;
}
.store-title-section p {
  font-size: 1.1rem;
  color: var(--store-gray-dark);
  max-width: 600px;
  margin: 0 auto;
}

/* Navigation & Directory Shortcuts */
.directory-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}
.shortcut-card {
  background: var(--store-white);
  padding: 24px;
  border-radius: var(--store-radius);
  text-align: center;
  text-decoration: none;
  color: var(--store-dark);
  box-shadow: var(--store-shadow-sm);
  border: 1px solid var(--store-gray);
  transition: var(--store-transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.shortcut-card:hover {
  transform: translateY(-5px);
  border-color: var(--store-green);
  box-shadow: var(--store-shadow-md);
}
.shortcut-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  transition: var(--store-transition);
}
.shortcut-card:hover .shortcut-icon {
  transform: scale(1.15);
}
.shortcut-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--store-green-dark);
}
.shortcut-card.active {
  border-color: var(--store-gold);
  background: var(--store-gold-light);
}

/* Filter Forms - Glassmorphism */
.filter-bar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  border-radius: var(--store-radius);
  border: 1px solid rgba(45, 122, 31, 0.15);
  box-shadow: var(--store-shadow-sm);
  margin-bottom: 40px;
}
.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) 120px;
  gap: 16px;
  align-items: end;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--store-green-dark);
}
.form-control {
  padding: 12px 16px;
  border: 1px solid var(--store-gray);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: var(--store-transition);
  background: var(--store-white);
  width: 100%;
  box-sizing: border-box;
}


.form-control:focus {
  border-color: var(--store-green);
  box-shadow: 0 0 0 3px rgba(45, 122, 31, 0.15);
}
.btn-store {
  padding: 12px 24px;
  background: var(--store-green);
  color: var(--store-white);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--store-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
}
.btn-store:hover {
  background: var(--store-green-dark);
  transform: translateY(-1px);
}
.btn-store-gold {
  background: var(--store-gold);
}
.btn-store-gold:hover {
  background: var(--store-gold-dark);
}
.btn-store-outline {
  background: transparent;
  border: 2px solid var(--store-green);
  color: var(--store-green);
}
.btn-store-outline:hover {
  background: var(--store-green);
  color: var(--store-white);
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* Classified Card */
.listing-card {
  background: var(--store-white);
  border-radius: var(--store-radius);
  overflow: hidden;
  box-shadow: var(--store-shadow-sm);
  border: 1px solid var(--store-gray);
  transition: var(--store-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--store-shadow-lg);
  border-color: rgba(45, 122, 31, 0.2);
}
.card-image-wrapper {
  position: relative;
  height: 220px;
  background-color: var(--store-gray);
  overflow: hidden;
}
.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--store-transition);
}
.listing-card:hover .card-image-wrapper img {
  transform: scale(1.05);
}
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--store-white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 2;
}
.badge-sell { background-color: var(--store-green); }
.badge-buy { background-color: var(--store-gold); }

.paid-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, var(--store-gold) 0%, var(--store-gold-dark) 100%);
  color: var(--store-white);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.listing-card.featured-card {
  border: 2px solid var(--store-gold);
}
.featured-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 45px 45px 0;
  border-color: transparent var(--store-gold) transparent transparent;
  z-index: 1;
}

/* Card Body Content */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-category {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--store-gold-dark);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.card-title {
  font-size: 1.25rem;
  color: var(--store-green-dark);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}
.card-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--store-dark);
  margin-bottom: 12px;
}
.card-price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--store-gray-dark);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--store-gray-dark);
  margin-bottom: 15px;
  border-bottom: 1px solid var(--store-gray);
  padding-bottom: 12px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-desc {
  font-size: 0.9rem;
  color: #4a5568;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.5em;
}
.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
}
.seller-name-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--store-green-dark);
}

/* Contact Masking Box */
.contact-detail-box {
  background: var(--store-green-light);
  border: 1px dashed var(--store-green);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 20px;
}
.contact-detail-box.guest-mode {
  background: #fdf2f2;
  border-color: #f8b4b4;
}
.masked-number {
  font-family: monospace;
  font-size: 1.2rem;
  letter-spacing: 2px;
  filter: blur(4px);
  user-select: none;
  margin-bottom: 10px;
}
.mask-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mask-overlay p {
  font-size: 0.85rem;
  color: var(--store-gray-dark);
}

/* Premium Login Cards */
.login-container {
  max-width: 450px;
  margin: 40px auto;
  background: var(--store-white);
  border-radius: var(--store-radius);
  padding: 40px;
  box-shadow: var(--store-shadow-lg);
  border: 1px solid var(--store-gray);
}
.login-header {
  text-align: center;
  margin-bottom: 30px;
}
.login-header h2 {
  font-family: 'Playfair Display', serif;
  color: var(--store-green-dark);
  font-size: 2rem;
  margin-bottom: 8px;
}
.login-header p {
  color: var(--store-gray-dark);
  font-size: 0.95rem;
}

/* Toast OTP Simulation Box */
.simulated-sms-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a202c;
  color: #fff;
  padding: 20px 24px;
  border-radius: var(--store-radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 9999;
  border-left: 5px solid var(--store-gold);
  max-width: 360px;
  animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast-header {
  font-weight: 700;
  color: var(--store-gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.toast-body {
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Image Upload Preview CSS */
.image-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--store-gray);
  border: 1px solid var(--store-gray);
}
.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.remove-preview-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--store-transition);
}
.remove-preview-btn:hover {
  background: rgba(229, 62, 62, 0.9);
}

/* Character Countdown Text */
.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--store-gray-dark);
  margin-top: 4px;
}

/* UPI payment layout checkout styles */
.checkout-box {
  max-width: 500px;
  margin: 0 auto;
  background: rgba(255,255,255,0.85);
  border-radius: var(--store-radius);
  padding: 30px;
  box-shadow: var(--store-shadow-md);
  border: 1px solid var(--store-gray);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
}
.checkout-box h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--store-green-dark);
  margin-bottom: 16px;
}
.qr-container {
  width: 200px;
  height: 200px;
  margin: 20px auto 30px;
  border: 2px solid var(--store-gold);
  border-radius: var(--store-radius);
  background: var(--store-white);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.qr-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed var(--store-gold);
  border-radius: var(--store-radius);
  animation: qrPulse 3s linear infinite;
}
@keyframes qrPulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}
.qr-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 3px solid var(--store-gold);
  border-radius: var(--store-radius);
  animation: qrScan 3s linear infinite;
  pointer-events: none;
  opacity: 0.4;
}
@keyframes qrScan {
  0% { clip-path: inset(0% 0% 95% 0%); }
  50% { clip-path: inset(95% 0% 0% 0%); }
  100% { clip-path: inset(0% 0% 95% 0%); }
}
.qr-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* User Dashboard CSS */
.dashboard-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
}
.dashboard-sidebar {
  background: var(--store-white);
  border-radius: var(--store-radius);
  padding: 24px;
  border: 1px solid var(--store-gray);
  height: fit-content;
}
.sidebar-profile {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--store-gray);
}
.avatar-placeholder {
  width: 70px;
  height: 70px;
  background: var(--store-green);
  color: var(--store-white);
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 12px;
}
.dashboard-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dashboard-nav-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--store-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--store-transition);
}
.dashboard-nav-list a:hover,
.dashboard-nav-list li.active a {
  background: var(--store-green-light);
  color: var(--store-green-dark);
}

/* Dashboard Table List styles */
.dashboard-content-card {
  background: var(--store-white);
  border-radius: var(--store-radius);
  padding: 30px;
  border: 1px solid var(--store-gray);
}
.table-responsive {
  overflow-x: auto;
}
.store-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
.store-table th,
.store-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--store-gray);
}
.store-table th {
  background-color: var(--store-gray-light);
  color: var(--store-green-dark);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
}
.store-table tbody tr:hover {
  background-color: rgba(45, 122, 31, 0.02);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-free { background-color: var(--store-green-light); color: var(--store-green-dark); }
.status-pending { background-color: #fef3c7; color: #d97706; }
.status-paid { background-color: #d1fae5; color: #059669; }
.status-expired { background-color: #fee2e2; color: #dc2626; }

/* Product Detail Grid */
.product-detail-grid {
  background: var(--store-white);
  border-radius: var(--store-radius);
  box-shadow: var(--store-shadow-md);
  border: 1px solid var(--store-gray);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  padding: 40px;
}

/* Responsive Form Grids */
.form-row-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-row-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 20px; }
.form-row-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-row-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* Responsive Form Container */
.form-card {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--store-shadow-md);
  border: 1px solid var(--store-gray);
}

/* Responsive adjustments */
@media(max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .filter-form {
    grid-template-columns: 1fr;
  }
  .product-detail-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
  .form-row-2-1, .form-row-1-2, .form-row-2, .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .form-card {
    padding: 20px !important;
  }
}


/* ═══════════════════════════════════════════
 *  AJAX TOAST NOTIFICATIONS
 * ═══════════════════════════════════════════ */
.ajax-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}
.ajax-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ajax-toast-show {
  transform: translateX(0);
  opacity: 1;
}
.ajax-toast-hide {
  transform: translateX(120%);
  opacity: 0;
}
.ajax-toast-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-left: 4px solid #34d399;
}
.ajax-toast-error {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-left: 4px solid #fca5a5;
}
.ajax-toast-info {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-left: 4px solid #93c5fd;
}
.ajax-toast-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 1px;
}
.ajax-toast-msg {
  flex: 1;
  font-weight: 500;
}
.ajax-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0 0 8px;
  line-height: 1;
  transition: color 0.2s;
}
.ajax-toast-close:hover {
  color: #fff;
}

/* ═══════════════════════════════════════════
 *  BUTTON LOADING STATE
 * ═══════════════════════════════════════════ */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════
 *  ROW REMOVAL ANIMATION (for AJAX delete)
 * ═══════════════════════════════════════════ */
.ajax-row-removing {
  animation: rowFadeOut 0.4s ease forwards;
}
@keyframes rowFadeOut {
  0%   { opacity: 1; transform: translateX(0); max-height: 200px; }
  60%  { opacity: 0.3; transform: translateX(30px); }
  100% { opacity: 0; transform: translateX(60px); max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

@media(max-width: 480px) {
  .ajax-toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}

/* Store Pagination matches Blog layout */
.store-pagination {
  margin-top: 50px; 
  display: flex; 
  justify-content: center; 
  gap: 10px; 
  align-items: center; 
  flex-wrap: wrap;
}
.store-pagination .btn-page {
  padding: 8px 15px;
  min-width: 40px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
}
.store-pagination .btn-page-outline {
  border: 1px solid var(--store-green);
  color: var(--store-green);
  background: transparent;
}
.store-pagination .btn-page-outline:hover {
  background: var(--store-green);
  color: var(--store-white);
}
.store-pagination .btn-page-active {
  background: var(--store-green);
  color: var(--store-white);
  border: 1px solid var(--store-green);
}

/* intlTelInput overrides to match contact.php layout and prevent text overlap */
.iti {
  display: block !important;
  width: 100% !important;
}

.iti input {
  width: 100% !important;
}

.iti__country-list {
  color: #1a202c;
  z-index: 1001;
}
/* TomSelect Overrides to match .form-control */
.ts-control {
    padding: 12px 16px;
    border: 1px solid var(--store-gray);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    background: var(--store-white);
    min-height: auto;
    box-shadow: none !important;
}
.ts-control.focus {
    border-color: var(--store-green) !important;
    box-shadow: 0 0 0 3px rgba(45, 122, 31, 0.15) !important;
}
.ts-wrapper.single .ts-control:after {
    border-color: var(--store-dark) transparent transparent transparent !important;
    border-width: 5px 5px 0 5px !important;
    right: 16px !important;
}
.ts-dropdown {
    border-radius: 8px;
    border: 1px solid var(--store-gray);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    margin-top: 4px;
}
.ts-dropdown .option {
    padding: 10px 16px;
}
.ts-dropdown .active {
    background-color: var(--store-green);
    color: var(--store-white);
}

/* Avoid double border / padding when select has .form-control */
.ts-wrapper.form-control {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    height: auto !important;
    line-height: normal !important;
}
