/* ============================================================
   MARJAN STORE - Premium Modern CSS
   Theme: Emerald & Slate with Golden Accents
   Typography: Outfit (Google Fonts)
   ============================================================ */

:root {
  /* Color Palette */
  --primary: #059669; /* Emerald 600 */
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --accent: #f59e0b; /* Amber 500 */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  
  /* Shared Styles */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Global Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
  color: white;
  padding: 4rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.logo {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 1.25rem;
  color: var(--slate-100);
  opacity: 0.9;
  font-weight: 300;
  margin-bottom: 2rem;
}

.search-bar {
  max-width: 500px;
  margin: 0 auto;
}

.search-bar input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.search-bar input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* ---------- Container ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-header {
  margin-bottom: 3rem;
  text-align: center;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--slate-700);
  font-size: 1.1rem;
}

/* ---------- Product Grid ---------- */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--slate-100);
  animation: slideUp 0.6s ease-out forwards;
  opacity: 0;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.card-img-container {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-img {
  transform: scale(1.1);
}

.card-body {
  padding: 1.5rem;
  flex-grow: 1;
}

.card h3 {
  font-size: 1.5rem;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
}

.card-short {
  color: var(--slate-700);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

.card-footer {
  padding: 1.25rem 1.5rem;
  background: var(--slate-50);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--slate-100);
}

.price-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- Buttons ---------- */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
}

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-700);
}

.btn-secondary:hover {
  background: var(--slate-200);
}

.btn-glow:hover {
  box-shadow: 0 0 15px rgba(5, 150, 105, 0.4);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--slate-100);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.close-btn:hover {
  background: var(--slate-200);
  transform: rotate(90deg);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .modal-body {
    grid-template-columns: 1fr;
  }
}

.modal-image-container {
  position: sticky;
  top: 0;
}

.modal-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px 0 0 24px;
}

@media (max-width: 768px) {
  .modal-image-container img {
    border-radius: 24px 24px 0 0;
  }
}

.modal-info {
  padding: 3rem 2rem 2rem 0;
}

@media (max-width: 768px) {
  .modal-info {
    padding: 2rem;
  }
}

.modal-info h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--slate-900);
}

.modal-desc {
  color: var(--slate-700);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ---------- Price Section ---------- */
.price-section {
  background: var(--slate-50);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border: 1px solid var(--slate-100);
}

.price-row, .qty-row, .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.label {
  color: var(--slate-700);
  font-weight: 500;
}

.price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--slate-900);
}

.total {
  font-size: 1.75rem;
  color: var(--primary);
}

/* ---------- Qty Input ---------- */
.qty-input {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
}

.qty-btn {
  background: white;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition);
}

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

#modal-qty {
  width: 50px;
  text-align: center;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  appearance: textfield;
}

/* ---------- Payment Form ---------- */
.payment-form {
  border-top: 1px solid var(--slate-200);
  padding-top: 2rem;
}

.payment-form h3 {
  margin-bottom: 1.5rem;
  color: var(--slate-900);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--slate-700);
}

.input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
}

.error {
  color: #ef4444;
  font-size: 0.8rem;
  display: block;
  margin-top: 0.25rem;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* ---------- Alerts ---------- */
.success-alert {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--slate-900);
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
}

.footer-content {
  opacity: 0.7;
}

.disclaimer {
  font-size: 0.85rem;
  margin-top: 1rem;
  color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--slate-50);
}
::-webkit-scrollbar-thumb {
  background: var(--slate-200);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-300);
}
