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

/* Respect user's motion preferences */
@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;
  }
}

/* Enable smooth scrolling only if user hasn't requested reduced motion */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1e1b17;
  background-color: #f9f1ea;
}

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

/* Skip Link for Screen Readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #1e1b17;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* Header Block */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(249, 241, 234, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #f3d3b4;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  position: relative;
  gap: 1rem;
}

/* Logo Block */
.logo {
  flex-shrink: 0;
}

.logo__image {
  height: 100px;
  width: 100px;
  object-fit: contain;
}

/* Navigation Block */
.nav {
  display: none;
  align-items: center;
  gap: 2rem;
  flex: 1;
  justify-content: center;
  margin: 0 2rem;
}

.nav__link {
  color: #1e1b17;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.nav__link:hover {
  color: #3c332c;
  background-color: rgba(243, 211, 180, 0.3);
}

.nav__link:focus {
  outline: 2px solid #1e1b17;
  outline-offset: 2px;
}

/* Header Actions Block */
.header-actions {
  display: none;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.header-actions__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  border-radius: 0.5rem;
  color: #1e1b17;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.header-actions__button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(243, 211, 180, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.header-actions__button:hover::before {
  width: 100%;
  height: 100%;
}

.header-actions__button:hover {
  color: #3c332c;
}

.header-actions__button:focus {
  outline: 2px solid #1e1b17;
  outline-offset: 2px;
}

.header-actions__icon {
  width: 20px;
  height: 20px;
  position: relative;
  z-index: 1;
}

/* Cart Counter Element */
.header-actions__cart-counter {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #e74c3c;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: scale(1);
  transition: transform 0.2s ease;
}

.header-actions__cart-counter--visible {
  transform: scale(1);
}

/* Mobile Menu Block */
.mobile-menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 4px;
  border-radius: 4px;
}

.mobile-menu:focus {
  outline: 2px solid #1e1b17;
  outline-offset: 2px;
}

.mobile-menu__line {
  width: 20px;
  height: 2px;
  background-color: #1e1b17;
  display: block;
  transition: all 0.3s ease;
}

.mobile-menu--active .mobile-menu__line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu--active .mobile-menu__line:nth-child(2) {
  opacity: 0;
}

.mobile-menu--active .mobile-menu__line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Panel */
.mobile-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  margin: 0 1rem;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: none;
}

.mobile-menu-panel--visible {
  display: block;
}

.mobile-menu-panel__nav {
  margin-bottom: 1rem;
}

.mobile-menu-panel__link {
  display: block;
  color: #1e1b17;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  min-height: 44px;
  transition: background-color 0.3s ease;
}

.mobile-menu-panel__link:hover,
.mobile-menu-panel__link:focus {
  background-color: #f3d3b4;
  outline: none;
}

/* Mobile Actions Block */
.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #f3d3b4;
  margin-top: 1rem;
}

.mobile-actions__button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  border-radius: 0.5rem;
  color: #1e1b17;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
  width: 100%;
  font-size: 1rem;
  position: relative;
}

.mobile-actions__button:hover,
.mobile-actions__button:focus {
  background-color: #f3d3b4;
  outline: none;
}

.mobile-actions__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-actions__counter {
  position: absolute;
  right: 1rem;
  background-color: #e74c3c;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: scale(1);
  transition: transform 0.2s ease;
}

.mobile-actions__counter--visible {
  transform: scale(1);
}

/* Button Block */
.button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

.button:focus {
  outline: 2px solid #1e1b17;
  outline-offset: 2px;
}

.button--primary {
  background-color: #1e1b17;
  color: white;
}

.button--primary:hover {
  background-color: #3c332c;
}

.button--outline {
  background-color: transparent;
  color: #1e1b17;
  border: 2px solid #1e1b17;
}

.button--outline:hover {
  background-color: #f3d3b4;
}

.button--outline-dark {
  background-color: transparent;
  color: #1e1b17;
  border: 2px solid #1e1b17;
}

.button--outline-dark:hover {
  background-color: white;
}

.button--large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-height: 48px;
}

/* Hero Section Block */
.hero {
  padding: 4rem 0 6rem;
}

.hero__content {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero__text {
  order: 1;
}

.hero__image {
  order: 2;
  position: relative;
}

.hero__info {
  margin-bottom: 2rem;
}

.hero__badge {
  background-color: #f3d3b4;
  color: #1e1b17;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
}

.hero__title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero__description {
  font-size: 1.125rem;
  color: #3c332c;
  line-height: 1.7;
}

.hero__buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero__stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 1rem;
}

.hero__image-container {
  background: linear-gradient(135deg, #f3d3b4, #f9f1ea);
  border-radius: 1rem;
  padding: 2rem;
}

.hero__product-image {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.hero__shipping-badge {
  position: absolute;
  top: -1rem;
  right: -1rem;
  background-color: #1e1b17;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Rating Block */
.rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rating__stars {
  display: flex;
  gap: 0.25rem;
}

.rating__star {
  color: #fbbf24;
}

.rating__text {
  color: #3c332c;
  font-weight: 600;
}

/* Customers Stats */
.customers {
  color: #3c332c;
}

.customers__count {
  font-weight: 700;
}

/* Features Section Block */
.features {
  padding: 4rem 0;
  background-color: white;
}

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

.features__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e1b17;
  margin-bottom: 1rem;
}

.features__description {
  font-size: 1.125rem;
  color: #3c332c;
  max-width: 42rem;
  margin: 0 auto;
}

.features__grid {
  display: grid;
  gap: 2rem;
}

/* Feature Card Block */
.feature-card {
  background-color: white;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.3s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .feature-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }
}

.feature-card__icon {
  background-color: #f3d3b4;
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-card__icon i {
  color: #1e1b17;
  font-size: 1.5rem;
}

.feature-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 0.5rem;
}

.feature-card__description {
  color: #3c332c;
}

/* Story Section Block */
.story {
  padding: 4rem 0;
  background-color: #1e1b17;
  color: white;
}

.story__content {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.story__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.story__paragraphs {
  margin-top: 1.5rem;
}

.story__paragraph {
  color: #d1d5db;
  margin-bottom: 1rem;
}

.story__image {
  background-color: #3c332c;
  border-radius: 1rem;
  padding: 2rem;
}

.story__team-image {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* CTA Section Block */
.cta {
  padding: 4rem 0;
  background-color: #f3d3b4;
}

.cta__content {
  text-align: center;
}

.cta__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e1b17;
  margin-bottom: 1rem;
}

.cta__description {
  font-size: 1.125rem;
  color: #3c332c;
  margin-bottom: 2rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.cta__buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* Footer Block */
.footer {
  background-color: #1e1b17;
  color: white;
  padding: 3rem 0;
}

.footer__content {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer__section {
  display: flex;
  flex-direction: column;
}

.footer__logo {
  height: 100px;
  width: 100px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
}

.footer__description {
  color: #9ca3af;
}

.footer__title {
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer__links {
  list-style: none;
}

.footer__link {
  color: #9ca3af;
  text-decoration: none;
  padding: 0.25rem 0;
  display: inline-block;
  min-height: 24px;
  transition: color 0.3s ease;
  margin-bottom: 0.5rem;
}

.footer__link:hover {
  color: white;
}

.footer__link:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.footer__bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
  color: #9ca3af;
}

/* Animation for cart items */
@keyframes cartBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.header-actions__button--animate {
  animation: cartBounce 0.3s ease;
}

/* Responsive Design */
@media (min-width: 640px) {
  .hero__buttons {
    flex-direction: row;
  }

  .hero__stats {
    flex-direction: row;
    gap: 3rem;
  }

  .cta__buttons {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }

  .mobile-menu {
    display: none;
  }

  .hero__title {
    font-size: 3rem;
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__content {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-actions {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .hero__content {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__text {
    order: 1;
  }

  .hero__image {
    order: 2;
  }

  .hero__title {
    font-size: 3.75rem;
  }

  .features__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .story__content {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__content {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .hero__title {
    font-size: 4rem;
  }

  .features__title,
  .cta__title,
  .story__title {
    font-size: 3rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .button--outline,
  .button--outline-dark {
    border-width: 3px;
  }

  .nav__link:focus,
  .button:focus,
  .footer__link:focus {
    outline-width: 3px;
  }
}
