/*! Main Application Stylesheet */
/* Loaded after critical CSS - non-blocking */

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  height: 100%;
  /* Prevent horizontal overflow on all pages */
  overflow-x: hidden;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-base);
  line-height: var(--line-height-base);
  color: var(--color-black);
  background-color: var(--color-white);
  margin: 0;
  padding: 0;
  /* Prevent horizontal overflow */
  overflow-x: hidden;
  max-width: 100vw;
}
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content area takes up available space */
main {
  flex: 1;
}


/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

/* Font face declarations - Using Sharp Sans TRIAL from stylesheet.css */
/* All font variants are already declared in stylesheet.css */

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

/* Skip to main content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-nava);
  color: var(--color-white);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only */
.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;
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-nava);
  outline-offset: 2px;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   PERFORMANCE OPTIMIZATIONS
   ========================================================================== */

/* Prevent layout shift for lazy-loaded images */
img[loading="lazy"] {
  content-visibility: auto;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Mobile: 320px - 767px (default styles) */

/* Tablet: 768px - 1023px */
@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-xl);
  }
}

/* Desktop: 1024px - 1439px */
@media (min-width: 1024px) {
  .container {
    padding: 0 calc(var(--spacing-xl) * 2);
  }
}

/* Wide: 1440px+ */
@media (min-width: 1440px) {
  .container {
    padding: 0 calc(var(--spacing-xl) * 3);
  }
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
  width: 100%;
}

.toast {
  position: relative;
  display: flex;
  gap: 40px;
  align-items: center;
  background-color: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 12px 16px;
  width: 460px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast__close {
  width: 30px;
  height: 30px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.toast__close:hover {
  background-color: #e0e0e0;
}

.toast__close svg {
  width: 10px;
  height: 10px;
  color: #ec7f7f;
}

.toast__message {
  flex: 1;
  display: flex;
  align-items: center;
  align-self: center;
  font-family: var(--font-bold);
  font-size: 16px;
  height: 100px;
  font-weight: 800;
  color: var(--color-black);
  line-height: 1.4;
  text-align: left;
}

/* Toast variants - simplified design */
.toast--success .toast__message {
  /* color: #28a745; */
}

.toast--error .toast__message {
  /* color: #dc3545; */
}

.toast--warning .toast__message {
  /* color: #ffc107; */
}

.toast--info .toast__message {
  /* color: #17a2b8; */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .toast {
    width: 100%;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .cart-page__checkout-btn,
  .cart-page__continue-shopping,
  .cart-item__quantity-btn,
  .cart-item__remove,
  .out-of-stock-modal,
  .out-of-stock-modal__content,
  .toast {
    transition: none;
  }
}
