/* 
==============================================
   Pinterest & iPhone Inspired Design System
   Clean, Minimal, Beautiful
==============================================
*/

:root {
  /* Modern Color Palette - Soft & Clean */
  --primary: #E57393;              /* Rose Pink */
  --primary-hover: #D1537A;        
  --secondary: #111111;            /* Deep Black */
  --accent: #767676;               /* Soft Gray */
  
  /* Backgrounds - Ultra Clean */
  --bg-primary: #FFFFFF;           /* Pure White */
  --bg-secondary: #F7F7F7;         /* Light Gray */
  --bg-hover: #F1F1F1;             /* Hover Gray */
  
  /* Text Colors - Clear Hierarchy */
  --text-primary: #111111;         /* Main Text */
  --text-secondary: #5F5F5F;       /* Secondary Text */
  --text-tertiary: #767676;        /* Tertiary Text */
  
  /* Borders & Shadows - Subtle */
  --border-light: #EFEFEF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  
  /* Spacing - Consistent */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border Radius - Smooth */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-primary: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Container */
.container-pinterest {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .container-pinterest {
    padding: 0 var(--space-lg);
  }
}

/* ==========================================
   Navigation - iPhone Style
========================================== */
.nav-pinterest {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-direction: row-reverse; /* RTL: Logo on right, actions on left */
}

.nav-logo {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-search {
  flex: 1;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px; /* RTL: Icon space on left */
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  font-size: 16px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  background: var(--bg-hover);
  box-shadow: var(--shadow-md);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-direction: row-reverse; /* RTL: Cart first (right), then wishlist, then account */
}

.nav-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.nav-icon-btn:hover {
  background: var(--bg-hover);
}

.nav-badge {
  position: absolute;
  top: 6px;
  left: 6px; /* RTL: Badge on left side */
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  z-index: 1;
}

/* ==========================================
   Hero Section - Pinterest Style
========================================== */
.hero-pinterest {
  padding: var(--space-2xl) 0;
  text-align: center;
}

.hero-title {
  font-size: clamp(32px, 5vw, 60px);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
}

/* ==========================================
   Buttons - iPhone Style
========================================== */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all 0.2s;
}

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

/* ==========================================
   Product Grid - Pinterest Masonry Style
========================================== */
.products-grid {
  column-count: 2;
  column-gap: var(--space-md);
  margin: var(--space-xl) 0;
}

@media (min-width: 768px) {
  .products-grid {
    column-count: 3;
    column-gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    column-count: 4;
  }
}

@media (min-width: 1440px) {
  .products-grid {
    column-count: 5;
  }
}

/* ==========================================
   Product Card - Clean & Minimal
========================================== */
.product-card {
  break-inside: avoid;
  margin-bottom: var(--space-md);
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.product-image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-secondary);
}

.product-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.4));
  opacity: 0;
  transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-actions {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s;
}

.product-card:hover .product-actions {
  opacity: 1;
  transform: translateY(0);
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.action-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

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

.product-info {
  padding: var(--space-md);
}

.product-title {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: #E57393 !important;
  margin-bottom: var(--space-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.add-to-cart-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.add-to-cart-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

/* ==========================================
   Categories - Horizontal Scroll
========================================== */
.categories-section {
  padding: var(--space-xl) 0;
  background: var(--bg-secondary);
}

.categories-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding: var(--space-sm) 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex-shrink: 0;
  padding: 12px 24px;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-chip:hover,
.category-chip.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

/* ==========================================
   Section Headers
========================================== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ==========================================
   Modal - iPhone Style
========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-hover);
}

.modal-body {
  padding: var(--space-lg);
}

/* ==========================================
   Form Elements - Clean & Modern
========================================== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.2s;
  background: white;
}

.form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.05);
}

/* ==========================================
   Notification - iPhone Style Toast
========================================== */
.toast-notification {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(20px);
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: toastSlideDown 0.3s ease-out;
  max-width: 90%;
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ==========================================
   Utilities
========================================== */
.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================
   Animations
========================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ==========================================
   Responsive Adjustments
========================================== */
@media (max-width: 767px) {
  .nav-search {
    display: none;
  }
  
  .hero-pinterest {
    padding: var(--space-xl) 0;
  }
  
  .products-grid {
    column-count: 2;
    column-gap: var(--space-sm);
  }
  
  .product-info {
    padding: var(--space-sm);
  }
}


/* ==========================================
   Product Image Zoom Effect - Modern & Smooth
========================================== */
.product-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.product-card:hover .product-image {
  transform: scale(1.08);
}

/* Smooth overlay on hover */
.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

/* Enhanced product card hover */
.product-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(229, 115, 147, 0.15);
}

/* Smooth animation for all images */
img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
