/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* ========================================
   TABLET (max-width: 1024px)
   ======================================== */
@media (max-width: 1024px) {
  :root {
    --text-5xl: 2.5rem;
    --text-6xl: 3rem;
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  /* Story Section */
  .story-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .story-image {
    order: -1;
    max-width: 500px;
    margin: 0 auto;
  }

  /* Story: img em fluxo normal (position: absolute colapsa em layout 1-coluna) */
  .story-image .image-placeholder {
    padding-bottom: 0;
    height: auto;
    min-height: 0;
  }

  .story-image .image-placeholder img {
    position: static;
    display: block;
    width: 100%;
    height: clamp(380px, 50vw, 520px);
    object-fit: cover;
  }

  /* Save the Date */
  .save-date-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
    text-align: center;
  }

  /* Gifts Grid */
  .gifts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Gift Modal */
  .gift-modal-header {
    grid-template-columns: 1fr;
  }

  .gift-modal-image {
    max-height: 300px;
  }
}

/* ========================================
   MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
  :root {
    --text-4xl: 2rem;
    --text-5xl: 2.25rem;
    --spacing-4xl: 4rem;
    --spacing-3xl: 3rem;
  }

  /* Navbar Mobile */
  .navbar-toggle {
    display: flex;
  }

  .navbar-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: var(--spacing-lg);
    gap: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }

  .navbar-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Hero */
  .hero-background {
    background-position: center 30%;
  }

  .hero-title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }

  .hero-subtitle {
    font-size: var(--text-xl);
  }

  .hero-countdown {
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
    justify-content: center;
  }

  .countdown-item {
    min-width: auto;
    padding: var(--spacing-sm);
  }

  .countdown-number {
    font-size: var(--text-3xl);
  }

  .hero-scroll {
    bottom: 40px;
  }

  /* Sections */
  .section {
    padding: var(--spacing-3xl) 0;
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  /* Photos Grid */
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Save the Date Cards */
  .save-date-card {
    padding: var(--spacing-lg);
  }

  .save-date-icon {
    font-size: 2.5rem;
  }

  /* CTA Section */
  .cta-title {
    font-size: var(--text-3xl);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-links ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
  }

  .footer-links li {
    margin-bottom: 0;
  }

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

  /* Lightbox */
  .lightbox-close {
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
  }

  .lightbox-prev {
    left: var(--spacing-sm);
  }

  .lightbox-next {
    right: var(--spacing-sm);
  }

  /* Story section: img em fluxo normal (position: absolute colapsa no mobile) */
  .story-image .image-placeholder {
    padding-bottom: 0;
    height: auto;
    min-height: 0;
  }

  .story-image .image-placeholder img {
    position: static;
    display: block;
    width: 100%;
    height: clamp(280px, 80vw, 420px);
    object-fit: cover;
  }

  /* Gifts Page */
  .gifts-title {
    font-size: var(--text-4xl);
  }

  .filter-categories {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    flex-shrink: 0;
  }

  .gifts-grid {
    grid-template-columns: 1fr;
  }

  /* Modals */
  .modal {
    padding: var(--spacing-lg);
    max-height: 95vh;
  }

  .gift-modal,
  .checkout-modal {
    width: 95%;
  }

  .gift-modal-actions,
  .checkout-actions {
    flex-direction: column;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }

  /* Checkout Steps */
  .checkout-steps {
    gap: var(--spacing-xs);
  }

  .step-label {
    font-size: 0.65rem;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: var(--text-sm);
  }
}

/* ========================================
   SMALL MOBILE (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
  :root {
    --text-3xl: 1.5rem;
    --text-4xl: 1.75rem;
    --spacing-2xl: 2rem;
  }

  .hero-content {
    padding: var(--spacing-lg);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-scroll {
    display: none;
  }

  .countdown-item {
    min-width: auto;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .countdown-number {
    font-size: var(--text-xl);
  }

  .countdown-label {
    font-size: 0.6rem;
  }

  /* Photos Grid - Single Column */
  .photos-grid {
    grid-template-columns: 1fr;
  }

  /* Buttons */
  .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  /* Gift Card */
  .gift-card-price-value {
    font-size: var(--text-xl);
  }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-3xl) 0;
  }

  .hero-countdown {
    margin-top: var(--spacing-lg);
  }

  .hero-scroll {
    display: none;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
  .navbar,
  .hero-scroll,
  .lightbox,
  .modal-overlay,
  .footer-social {
    display: none !important;
  }

  .hero {
    min-height: auto;
    margin-top: 0;
    page-break-after: always;
  }

  .section {
    page-break-inside: avoid;
  }

  body {
    font-size: 12pt;
    color: black;
    background: white;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-indicator span {
    animation: none;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #a04040;
    --color-gray: #555555;
    --color-gray-light: #cccccc;
  }

  .btn {
    border-width: 3px;
  }

  .form-input,
  .form-textarea {
    border-width: 2px;
  }
}
