/* ========================================
   FLUIDITY & UI IMPROVEMENTS 2025
   Natural, smooth, accessible experience
   ======================================== */

/* ===== PRODUCT GRID — limit card width so 1 product isn't full-screen ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 340px));
  justify-content: center;
  gap: 24px;
}

.product-card {
  max-width: 340px;
  width: 100%;
}


/* ===== SMOOTH SECTION TRANSITIONS ===== */
section {
  scroll-margin-top: 80px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Simple fade-in for sections - works everywhere */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* Apply animation only when reduced motion is not preferred */
@media (prefers-reduced-motion: no-preference) {
  section:not(:first-of-type) {
    animation: fadeInUp 0.6s ease forwards;
  }

  /* Stagger animations for better flow */
  section:nth-child(1) {
    animation-delay: 0.1s;
  }

  section:nth-child(2) {
    animation-delay: 0.2s;
  }

  section:nth-child(3) {
    animation-delay: 0.3s;
  }

  section:nth-child(4) {
    animation-delay: 0.4s;
  }

  section:nth-child(5) {
    animation-delay: 0.5s;
  }
}

/* ===== IMPROVED SPACING ===== */
.main>section {
  padding: clamp(48px, 8vw, 96px) 0;
}

.main>section:first-of-type {
  padding-top: clamp(32px, 6vw, 64px);
}

.main>section:last-of-type {
  padding-bottom: clamp(64px, 10vw, 120px);
}

.container {
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}

/* ===== ENHANCED FOCUS STATES ===== */
*:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-offset 0.2s ease;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 4px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  section {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== IMPROVED TYPOGRAPHY FLOW ===== */
.section-subtitle {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  font-size: clamp(1rem, 2vw, 1.125rem);
}

/* ===== BETTER BUTTON INTERACTIONS ===== */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: scale(0.98);
}

/* ===== IMPROVED FORM INPUTS ===== */
.input,
.textarea,
.select {
  transition: all 0.25s ease;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
}

.input:hover,
.textarea:hover,
.select:hover {
  border-color: rgba(15, 23, 42, 0.2);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.1);
  transform: translateY(-1px);
}


/* ===== IMPROVED CARD INTERACTIONS ===== */
.product-card,
.info-card,
.review-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover,
.info-card:hover,
.review-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* ===== BETTER MOBILE EXPERIENCE ===== */
@media (max-width: 768px) {
  .main>section {
    padding: clamp(32px, 6vw, 64px) 0;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }

  .footer-brand {
    align-items: center;
    justify-content: center;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-links {
    justify-content: center;
    gap: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .footer-column {
    align-items: center;
    text-align: center;
    flex: 1 1 auto;
    min-width: 0;
  }

  .footer-column ul {
    align-items: center;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .footer-column li {
    width: 100%;
  }

  .footer-column a {
    justify-content: center;
    width: 100%;
    min-height: unset !important;
    padding: 4px 8px;
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .social-links {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .social-link {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .social-link svg {
    width: 22px !important;
    height: 22px !important;
  }
}

.section-title {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: clamp(0.95rem, 3vw, 1.05rem);
  margin-bottom: 1.5rem;
}

.btn {
  padding: 12px 20px;
  font-size: 0.95rem;
}

/* ===== IMPROVED LOADING STATES ===== */
.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== SMOOTH MODAL TRANSITIONS ===== */
.modal {
  animation: fadeIn 0.3s ease;
}

.modal-content {
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

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

/* ===== IMPROVED NAVIGATION ===== */
.nav a:not(.btn) {
  position: relative;
  transition: color 0.25s ease;
}

.nav a:not(.btn)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-600);
  transition: width 0.3s ease;
}

.nav a:not(.btn):hover::after,
.nav a:not(.btn):focus-visible::after {
  width: 100%;
}

/* ===== BETTER SPACING BETWEEN ELEMENTS ===== */
.hero-actions {
  gap: clamp(16px, 3vw, 24px);
  flex-wrap: wrap;
  justify-content: center;
}

.contact-content {
  gap: clamp(32px, 6vw, 64px);
}

.contact-details {
  gap: clamp(16px, 3vw, 24px);
}

.footer-content {
  gap: clamp(32px, 6vw, 64px);
}

/* ===== IMPROVED RESPONSIVE BREAKPOINTS ===== */
@media (min-width: 640px) {
  .container {
    padding-left: clamp(24px, 5vw, 40px);
    padding-right: clamp(24px, 5vw, 40px);
  }
}

@media (min-width: 1024px) {
  .main>section {
    padding: clamp(64px, 10vw, 120px) 0;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-600);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 8px 0;
}

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

/* ===== IMPROVED VISUAL HIERARCHY ===== */
.section-title {
  margin-bottom: clamp(12px, 2vw, 24px);
}

.section-subtitle {
  margin-bottom: clamp(24px, 4vw, 48px);
}

/* ===== SMOOTH COLOR TRANSITIONS ===== */
* {
  transition-property: background-color, border-color, color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

/* ===== IMPROVED TOUCH TARGETS ===== */
@media (pointer: coarse) {

  .btn,
  a,
  button,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== BETTER EMPTY STATES ===== */
.empty {
  padding: clamp(48px, 8vw, 96px) 24px;
  text-align: center;
}

.empty::before {
  display: block;
  font-size: clamp(3rem, 8vw, 5rem);
  margin-bottom: 24px;
  opacity: 0.6;
}

/* ===== IMPROVED CART DRAWER ===== */
.cart-drawer {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-overlay {
  transition: opacity 0.3s ease;
}

/* ===== SMOOTH PRODUCT GRID ===== */
.product-grid {
  gap: clamp(16px, 3vw, 24px);
}

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

/* ===== IMPROVED FOOTER ===== */
.footer {
  margin-top: clamp(40px, 8vw, 80px);
  padding-top: clamp(32px, 6vw, 48px);
}

.footer-content {
  gap: clamp(32px, 6vw, 64px);
}

/* ===== BETTER VIDEO SECTION ===== */
.video-wrapper {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.2);
}

/* ===== IMPROVED NEWSLETTER FORM ===== */
.newsletter-form {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-form .form-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.newsletter-form .input {
  flex: 1;
  min-width: 200px;
}

/* ===== BETTER CONTACT FORM ===== */
.contact-form {
  max-width: 600px;
}

.contact-form .form-group {
  margin-bottom: 20px;
}

/* ===== SMOOTH PAGE LOAD ===== */
@keyframes pageLoad {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body {
  animation: pageLoad 0.6s ease;
}

/* ===== IMPROVED HERO SECTION ===== */
.hero {
  animation: fadeIn 0.8s ease;
}

.hero-content {
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

/* ===== BETTER SHOP TOOLBAR ===== */
.shop-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* ===== IMPROVED PRODUCT DETAIL ===== */
.product-detail-grid {
  gap: clamp(32px, 6vw, 64px);
}

/* ===== BETTER ERROR STATES ===== */
.form-error {
  animation: slideDown 0.3s ease;
  margin-top: 12px;
}

.form-success {
  animation: slideDown 0.3s ease;
  margin-top: 12px;
}

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

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

/* ===== IMPROVED TOAST NOTIFICATIONS ===== */
.toast {
  animation: toastSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ===== BETTER RESPONSIVE IMAGES ===== */
img {
  height: auto;
  max-width: 100%;
  object-fit: cover;
}

.product-media img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
}

/* ===== IMPROVED ACCESSIBILITY ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== SMOOTH HOVER EFFECTS ===== */
a:not(.btn):not(.nav a) {
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

a:not(.btn):not(.nav a):hover {
  text-decoration-color: currentColor;
}

/* ===== BETTER FOCUS INDICATORS ===== */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ===== IMPROVED SPACING UTILITIES ===== */
.mt-auto {
  margin-top: auto;
}

.mb-auto {
  margin-bottom: auto;
}

.ml-auto {
  margin-left: auto;
}

.mr-auto {
  margin-right: auto;
}

/* ===== SMOOTH SCROLL INDICATOR ===== */
@media (min-width: 1024px) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-500) transparent;
  }

  html::-webkit-scrollbar {
    width: 8px;
  }

  html::-webkit-scrollbar-track {
    background: transparent;
  }

  html::-webkit-scrollbar-thumb {
    background: var(--brand-500);
    border-radius: 4px;
  }

  html::-webkit-scrollbar-thumb:hover {
    background: var(--brand-600);
  }
}