/* =================================================================
   RainShine Store - Production-Grade eCommerce Styles
   Classic eCommerce Design System
   ================================================================= */

/* === CHECKOUT STEPS === */
.checkout-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 2rem;
}

.checkout-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--gray-300);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
  text-align: center;
}

.step.active .step-number {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.step.completed .step-number {
  background: var(--success);
  color: white;
}

.step.completed .step-label {
  color: var(--success);
}

.step.completed .step-number::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
}

.checkout-step-content {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === CSS VARIABLES / DESIGN TOKENS === */
:root {
  /* Primary Colors */
  --primary: #1E40AF;
  --primary-dark: #1E3A8A;
  --primary-light: #3B82F6;
  
  /* Secondary Colors */
  --secondary: #F97316;
  --secondary-dark: #EA580C;
  --secondary-light: #FB923C;
  
  /* Feedback Colors */
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  
  /* Neutral Colors */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Typography */
  --font-base: 16px;
  --font-sm: 0.875rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 2rem;
  --line-height: 1.6;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* === BASE STYLES === */

/* Hide Alpine.js x-cloak elements until Alpine initialises.
   Without this rule the x-show="open" dropdown is visible as plain HTML
   in any environment where Alpine.js is blocked or slow to load. */
[x-cloak] { display: none !important; }

* {
  box-sizing: border-box;
}

html {
  font-size: var(--font-base);
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: var(--line-height);
  color: var(--gray-900);
  background-color: #fff;
  margin: 0;
  padding: 0;
}

/* === UTILITY CLASSES === */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox Utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid Utilities */
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-lg { font-size: var(--font-lg); }
.text-xl { font-size: var(--font-xl); }
.text-2xl { font-size: var(--font-2xl); }
.text-3xl { font-size: var(--font-3xl); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }

/* Colors */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }
.text-white { color: #fff; }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-white { background-color: #fff; }

/* Width & Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-7xl { max-width: 80rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-2xl { max-width: 42rem; }

/* Border */
.border { border: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow */
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Hover Effects */
.hover-shadow:hover { box-shadow: var(--shadow-md); }
.hover-scale:hover { transform: scale(1.02); }
.transition { transition: all var(--transition); }

/* === HEADER STYLES === */
.header-top {
  background-color: var(--gray-900);
  color: white;
  font-size: var(--font-sm);
  padding: 0.5rem 0;
}

.header-main {
  background-color: #FFFDD9;
  border-bottom: 1px solid #e8e4a0;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo:hover {
  color: var(--primary-dark);
}

.search-bar {
  max-width: 600px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-full);
  font-size: var(--font-base);
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.search-button:hover {
  background-color: var(--primary-dark);
}

.header-icons {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header-icon {
  position: relative;
  color: var(--gray-700);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.header-icon:hover {
  color: var(--primary);
}

.icon-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--secondary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
  z-index: 1001;
}

.icon-badge-pulse {
  animation: badgePulse 0.5s ease-in-out;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* === NAVIGATION === */
.main-nav {
  background-color: var(--primary);
  padding: 0;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
}

.nav-link-item a {
  color: white;
  text-decoration: none;
  padding: 1rem 1.5rem;
  display: block;
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.nav-link-item a:hover {
  background-color: var(--primary-dark);
}

/* === FOOTER === */
.footer {
  background-color: #0112A3;
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
  position: relative;
  transition: transform 0.3s ease-in-out;
  transform: translateY(calc(100% - 50px));
}

.footer.footer-visible {
  transform: translateY(0);
}

.footer-toggle {
  position: absolute;
  top: -40px;
  right: 2rem;
  background-color: #0112A3;
  color: white;
  border: none;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-fast);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-toggle:hover {
  background-color: #010e82;
  transform: translateY(-2px);
}

.footer-toggle i {
  font-size: 1.25rem;
}

.footer-section h3 {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: var(--font-sm);
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.social-icon {
  color: rgba(255,255,255,0.72);
  font-size: 1.5rem;
  transition: color var(--transition-fast);
}

.social-icon:hover {
  color: white;
}

/* === BUTTONS === */
.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

/* === CARDS === */
.card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-img {
  width: 100%;
  height: auto;
  display: block;
}

.card-body {
  padding: 1.5rem;
}

/* === PRODUCT CARD === */
.product-card {
  position: relative;
  background-color: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background-color: var(--secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: var(--font-sm);
  font-weight: 600;
  z-index: 10;
}

.product-img-wrapper {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  background-color: var(--gray-100);
}

.product-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-info {
  padding: 1rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0.5rem 0;
}

.product-price-old {
  font-size: 1rem;
  color: var(--gray-500);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--warning);
  margin-bottom: 0.5rem;
}

/* === CART PAGE === */
.cart-item {
  transition: opacity 0.3s ease-out;
}

/* === FILTER SIDEBAR === */
.list-group-item-action {
  color: var(--gray-700) !important;
  text-decoration: none;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.list-group-item-action:hover {
  background-color: var(--gray-100) !important;
  color: var(--primary) !important;
  padding-left: 0.75rem !important;
}

.list-group-item-action.active {
  background-color: var(--primary) !important;
  color: white !important;
  font-weight: 600;
  border-left: 4px solid var(--primary-dark);
  padding-left: 0.75rem !important;
}

.cart-item:last-child {
  border-bottom: none !important;
}

/* === PAGINATION === */
.pagination {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.pagination .page-link {
  color: var(--primary);
  border-color: var(--gray-300);
  padding: 0.5rem 0.75rem;
  margin: 0 0.125rem;
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.pagination .page-link:hover {
  background-color: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
}

.pagination .page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

.pagination .page-item.disabled .page-link,
.pagination .page-item.disabled span {
  color: var(--gray-400);
  pointer-events: none;
  background-color: transparent;
  border-color: var(--gray-300);
}

/* === MAIN CONTENT SPACING === */
main {
  min-height: 70vh;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .search-bar { max-width: 100%; }
  .nav-links { flex-direction: column; }
  .header-icons { gap: 1rem; }
  
  /* Cart responsive */
  .cart-item .col-md-2,
  .cart-item .col-md-4 {
    margin-bottom: 0.5rem;
  }
  
  main {
    min-height: 50vh;
    padding-bottom: 3rem !important;
  }
  
  .footer {
    margin-top: 2rem;
  }
}

@media (max-width: 640px) {
  .grid-cols-2 { grid-template-columns: 1fr; }
  .text-3xl { font-size: 1.5rem; }
  .text-2xl { font-size: 1.25rem; }
  
  main {
    padding-bottom: 4rem !important;
  }
}
