/* Products Grid (Spans full container width to match top section) */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* Product Card */
.product-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(200, 151, 62, 0.32);
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(34, 22, 16, 0.09);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(200, 151, 62, 0.22);
  border-color: var(--color-accent-gold);
}

.product-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  min-height: 750px;
  background: #ffffff;
  border-bottom: 1px solid rgba(200, 151, 62, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform var(--transition-smooth);
}

.product-card:hover .product-image-container img {
  transform: scale(1.03);
}

.product-content {
  padding: 1.15rem 1.4rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: #ffffff;
}

.product-title {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  color: #1e130c;
}

/* Pricing Block */
.product-pricing-block {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.95rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(200, 151, 62, 0.16);
}

.mrp-row {
  font-size: 0.8rem;
  color: #887d75;
  text-decoration: line-through;
  font-weight: 500;
}

.selling-price-row {
  font-size: 1.32rem;
  font-weight: 800;
  color: #1e130c;
  font-family: var(--font-body);
}

/* Compact Purchase Action Row */
.product-purchase-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.qty-control-wrapper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.qty-label-small {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #6a5749;
  letter-spacing: 0.04em;
}

/* Quantity Stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #d4c5b3;
  border-radius: 6px;
  background: #fbf8f4;
  height: 38px;
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 100%;
  border: none;
  background: transparent;
  color: #2b1a11;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.qty-btn:hover {
  background: #ecdcc9;
  color: #000000;
}

.qty-btn:active {
  background: #d8c2aa;
}

.qty-input {
  width: 40px;
  height: 100%;
  border: none;
  border-left: 1px solid #e2d7c8;
  border-right: 1px solid #e2d7c8;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: #22120e;
  background: #ffffff;
  -moz-appearance: textfield;
  outline: none;
}

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

/* Redesigned Compact Buy Now Button */
.btn-buy-now {
  flex-grow: 1;
  height: 38px;
  padding: 0 1.2rem;
  background: linear-gradient(135deg, #3d1c08 0%, #241003 100%);
  color: #faf4e8;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid rgba(200, 151, 62, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 3px 10px rgba(36, 16, 3, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-buy-now:hover {
  background: linear-gradient(135deg, #c8973e 0%, #a87620 100%);
  color: #ffffff;
  border-color: #c8973e;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(200, 151, 62, 0.35);
}

.btn-buy-now:active {
  transform: translateY(0);
}

.btn-buy-now.adding {
  background: #8b7463;
  color: #ffffff;
  cursor: wait;
}

/* Modal Popup Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 16, 12, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(200, 151, 62, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  transform: translateY(20px) scale(0.96);
  transition: all var(--transition-smooth);
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem 2rem;
  background: var(--color-bg-warm);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.35rem;
  color: var(--color-primary-dark);
}

.modal-close-btn {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 2rem;
}

.modal-form-group {
  margin-bottom: 1.25rem;
}

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

.modal-input,
.modal-select,
.modal-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg-ivory);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
  outline: none;
  border-color: var(--color-accent-gold);
  background: #ffffff;
}

.modal-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Responsive Product Grid */
@media (max-width: 868px) {
  .products-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .product-image-container {
    height: clamp(320px, 75vw, 440px);
  }

  .product-content {
    padding: 1.25rem 1.4rem;
  }

  .product-action-buttons {
    grid-template-columns: 1fr;
  }
}
