/* ========================================
 * Customer Website Global Styles
 * Imported only in CustomerLayout.astro
 * ======================================== */

/* === Theme Variables === */
:root {
  --c-primary: #113511;
  --c-primary-hover: #1a4d1a;
  --c-primary-light: rgba(17, 53, 17, 0.08);
  --c-primary-rgb: 17, 53, 17;
  --c-accent: #4CAF50;
  --c-accent-light: rgba(76, 175, 80, 0.12);

  --c-bg: #FAFAF5;
  --c-bg-secondary: #F5F4EF;
  --c-surface: #FFFFFF;
  --c-surface-hover: #F9F9F5;
  --c-text: #1A1A1A;
  --c-text-secondary: #6B6B6B;
  --c-text-muted: #9CA3AF;
  --c-border: #E8E8E0;
  --c-border-hover: #D1D1C8;
  --c-divider: #F0F0E8;

  --c-error: #E53935;
  --c-error-light: rgba(229, 57, 53, 0.1);
  --c-success: #43A047;
  --c-success-light: rgba(67, 160, 71, 0.1);
  --c-warning: #FB8C00;
  --c-warning-light: rgba(251, 140, 0, 0.1);
  --c-info: #1976D2;
  --c-info-light: rgba(25, 118, 210, 0.1);

  --c-radius-xs: 6px;
  --c-radius-sm: 8px;
  --c-radius: 12px;
  --c-radius-lg: 16px;
  --c-radius-xl: 20px;
  --c-radius-full: 9999px;

  --c-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --c-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --c-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --c-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --c-shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.14);

  --c-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --c-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --c-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --c-navbar-height: 64px;
  --c-mobile-nav-height: 64px;
  --c-max-width: 1280px;
  --c-container-padding: 1rem;
}

@media (min-width: 640px) {
  :root {
    --c-container-padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --c-container-padding: 2rem;
  }
}

@media (min-width: 1536px) {
  :root {
    --c-max-width: 1440px;
    --c-container-padding: 3rem;
  }
}

@media (min-width: 1920px) {
  :root {
    --c-max-width: 1600px;
    --c-container-padding: 4rem;
  }
}

/* === Customer Page Base === */
.customer-page {
  background: var(--c-bg);
  min-height: 100vh;
  color: var(--c-text);
}

.customer-page main {
  margin-top: var(--c-navbar-height);
  padding-bottom: calc(var(--c-mobile-nav-height) + 1rem);
}

@media (min-width: 1024px) {
  .customer-page main {
    padding-bottom: 0;
  }
}

/* === Customer Container === */
.customer-container {
  width: 100%;
  max-width: var(--c-max-width);
  margin: 0 auto;
  padding: 0 var(--c-container-padding);
}

/* === Animations === */
@keyframes c-fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes c-slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes c-slideDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes c-slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes c-slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes c-scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes c-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes c-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes c-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes c-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.c-animate-fadeIn {
  animation: c-fadeIn var(--c-transition) ease-out;
}

.c-animate-slideUp {
  animation: c-slideUp var(--c-transition) ease-out;
}

.c-animate-scaleIn {
  animation: c-scaleIn var(--c-transition) ease-out;
}

.c-animate-pop {
  animation: c-pop 0.3s ease-out;
}

.c-animate-shake {
  animation: c-shake 0.4s ease-out;
}

/* === Skeleton Loader === */
.c-skeleton {
  background: linear-gradient(90deg,
      var(--c-border) 25%,
      var(--c-divider) 37%,
      var(--c-border) 63%);
  background-size: 200% 100%;
  animation: c-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--c-radius-sm);
}

.c-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.c-skeleton-text.short {
  width: 60%;
}

.c-skeleton-text.medium {
  width: 80%;
}

.c-skeleton-text.long {
  width: 100%;
}

.c-skeleton-circle {
  border-radius: 50%;
}

.c-skeleton-image {
  aspect-ratio: 1;
  border-radius: var(--c-radius);
}

/* === Customer Buttons === */
.c-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--c-radius-sm);
  cursor: pointer;
  transition: all var(--c-transition);
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  text-decoration: none;
  line-height: 1.4;
}

.c-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.c-btn-primary {
  background: var(--c-primary);
  color: #fff;
}

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

.c-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.c-btn-secondary {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}

.c-btn-secondary:hover:not(:disabled) {
  background: var(--c-surface-hover);
  border-color: var(--c-border-hover);
}

.c-btn-ghost {
  background: transparent;
  color: var(--c-primary);
}

.c-btn-ghost:hover:not(:disabled) {
  background: var(--c-primary-light);
}

.c-btn-icon {
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--c-radius-full);
}

.c-btn-sm {
  min-height: 36px;
  padding: 0.375rem 1rem;
  font-size: 0.85rem;
}

.c-btn-lg {
  min-height: 52px;
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
}

.c-btn-full {
  width: 100%;
}

/* === Customer Inputs === */
.c-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--c-radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  color: var(--c-text);
  min-height: 48px;
  transition: all var(--c-transition-fast);
  outline: none;
}

.c-input::placeholder {
  color: var(--c-text-muted);
}

.c-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), 0.1);
}

.c-input.error {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px var(--c-error-light);
}

/* === Customer Cards === */
.c-card {
  background: var(--c-surface);
  border-radius: var(--c-radius);
  border: 1px solid var(--c-border);
  overflow: hidden;
  transition: all var(--c-transition);
}

.c-card-interactive {
  cursor: pointer;
}

.c-card-interactive:hover {
  border-color: var(--c-border-hover);
  box-shadow: var(--c-shadow-sm);
  transform: translateY(-2px);
}

/* === Overlay / Backdrop === */
.c-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  animation: c-fadeIn var(--c-transition-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* === Badge === */
.c-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--c-radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.c-badge-primary {
  background: var(--c-primary);
  color: #fff;
}

.c-badge-error {
  background: var(--c-error);
  color: #fff;
}

.c-badge-success {
  background: var(--c-success);
  color: #fff;
}

/* === Scrollbar (Customer) === */
.customer-page ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.customer-page ::-webkit-scrollbar-track {
  background: transparent;
}

.customer-page ::-webkit-scrollbar-thumb {
  background: rgba(var(--c-primary-rgb), 0.15);
  border-radius: var(--c-radius-full);
}

.customer-page ::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--c-primary-rgb), 0.25);
}

/* === Selection === */
.customer-page ::selection {
  background: rgba(var(--c-primary-rgb), 0.15);
  color: var(--c-text);
}

/* === Focus Visible (Customer) === */
.customer-page *:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-primary);
}

/* === Price Styles === */
.c-price-current {
  font-weight: 700;
  color: var(--c-primary);
  font-size: 1em;
}

.c-price-old {
  font-weight: 400;
  color: var(--c-text-muted);
  text-decoration: line-through;
  font-size: 0.85em;
}

.c-discount-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--c-radius-xs);
  background: var(--c-error);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* === Section Headers === */
.c-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 var(--c-container-padding);
}

.c-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
}

.c-section-see-all {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity var(--c-transition-fast);
}

.c-section-see-all:hover {
  opacity: 0.7;
}