/* ============================================
   DALGONA NARA - Responsive Styles
   ============================================ */

/* ========== Breakpoints ==========
   Mobile:       <= 480px (1 column)
   Tablet:       481px - 768px (2 columns)
   Desktop:      769px - 1199px (3 columns)
   Large Desktop: >= 1200px (4 columns)
   ================================== */

/* ========== Large Desktop (1200px+) ========== */
@media (min-width: 1200px) {
  .container {
    padding: 0 var(--spacing-xl);
  }

  h1 {
    font-size: var(--font-size-5xl);
  }

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

/* ========== Desktop (769px - 1199px) ========== */
@media (max-width: 1199px) {
  :root {
    --font-size-5xl: 3rem;
    --font-size-4xl: 2.5rem;
    --font-size-3xl: 2rem;
  }

  .container {
    max-width: 960px;
  }

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

/* ========== Tablet (481px - 768px) ========== */
@media (max-width: 768px) {
  :root {
    --font-size-5xl: 2.5rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
    --header-height: var(--header-height-mobile);
    --spacing-5xl: 4rem;
    --spacing-4xl: 3rem;
  }

  body {
    font-size: var(--font-size-base);
  }

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

  .section {
    padding: var(--spacing-4xl) 0;
  }

  /* Grid Adjustments */
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* Typography */
  h1 {
    font-size: var(--font-size-4xl);
  }

  h2 {
    font-size: var(--font-size-2xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  /* Section Headers */
  .section-title {
    font-size: var(--font-size-2xl);
  }

  .section-desc {
    font-size: var(--font-size-base);
  }

  /* Header & Navigation */
  .header {
    height: var(--header-height-mobile);
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-secondary);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: var(--spacing-2xl);
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: var(--z-fixed);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-menu li {
    margin: var(--spacing-md) 0;
  }

  .nav-menu a {
    font-size: var(--font-size-lg);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .nav-cta {
    margin-top: var(--spacing-lg);
    margin-left: 0;
  }

  /* Hero Section */
  .hero {
    min-height: 80vh;
    padding: var(--spacing-4xl) 0;
  }

  .hero-content {
    text-align: center;
  }

  .hero-title {
    font-size: var(--font-size-4xl);
  }

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

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
  }

  .hero-buttons .btn {
    width: 100%;
    max-width: 280px;
  }

  /* About Section */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .about-image {
    order: -1;
  }

  /* Category Cards */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Product Cards */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  /* Tabs */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs-list {
    flex-wrap: nowrap;
    min-width: max-content;
    padding-bottom: var(--spacing-sm);
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-brand {
    grid-column: span 2;
    text-align: center;
    margin-bottom: var(--spacing-lg);
  }

  /* Cards */
  .card {
    padding: var(--spacing-md);
  }

  /* Buttons */
  .btn-lg {
    padding: var(--btn-padding-md);
    font-size: var(--btn-font-size-md);
  }
}

/* ========== Mobile (480px and below) ========== */
@media (max-width: 480px) {
  :root {
    --font-size-5xl: 2rem;
    --font-size-4xl: 1.75rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
    --font-size-xl: 1.125rem;
    --spacing-5xl: 3rem;
    --spacing-4xl: 2.5rem;
    --spacing-3xl: 2rem;
  }

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

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

  /* All grids to single column */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  /* Typography */
  h1 {
    font-size: var(--font-size-3xl);
  }

  h2 {
    font-size: var(--font-size-xl);
  }

  h3 {
    font-size: var(--font-size-lg);
  }

  .section-header {
    margin-bottom: var(--spacing-xl);
  }

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

  .section-desc {
    font-size: var(--font-size-sm);
  }

  /* Hero */
  .hero {
    min-height: 70vh;
    padding: var(--spacing-3xl) 0;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
    line-height: 1.3;
  }

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

  /* Categories */
  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    flex-direction: row;
    text-align: left;
    gap: var(--spacing-md);
  }

  .category-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }

  /* Products */
  .product-grid {
    grid-template-columns: 1fr;
  }

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

  /* Tabs */
  .tab-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-brand {
    grid-column: span 1;
  }

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

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

  /* Contact Info */
  .contact-info {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

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

  .btn-group {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  /* Forms */
  .form-row {
    flex-direction: column;
  }

  input,
  textarea,
  select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* Cards */
  .card {
    padding: var(--spacing-md);
  }

  .card-title {
    font-size: var(--font-size-md);
  }

  /* Banner */
  .banner-content {
    padding: var(--spacing-lg);
  }

  .banner-title {
    font-size: var(--font-size-xl);
  }
}

/* ========== Extra Small (320px) ========== */
@media (max-width: 320px) {
  :root {
    --font-size-5xl: 1.75rem;
    --font-size-4xl: 1.5rem;
    --font-size-3xl: 1.25rem;
  }

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

  .hero-title {
    font-size: var(--font-size-2xl);
  }
}

/* ========== Landscape Mobile ========== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: var(--spacing-xl) 0;
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }
}

/* ========== Print Styles ========== */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  .header,
  .footer,
  .nav-menu,
  .mobile-menu-toggle,
  .btn {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  a {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* ========== High Contrast Mode ========== */
@media (prefers-contrast: high) {
  :root {
    --color-primary-gold: #B8895A;
    --color-text-dark: #000000;
    --color-text-muted: #333333;
  }

  .btn {
    border-width: 3px;
  }

  a:focus {
    outline-width: 3px;
  }
}

/* ========== 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-behavior: auto !important;
  }
}

/* ========== Responsive Visibility Utilities ========== */
.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

.hide-tablet {
  display: block;
}

.show-tablet {
  display: none;
}

@media (min-width: 481px) and (max-width: 768px) {
  .hide-tablet {
    display: none !important;
  }

  .show-tablet {
    display: block !important;
  }
}

.hide-desktop {
  display: block;
}

.show-desktop {
  display: none;
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }

  .show-desktop {
    display: block !important;
  }
}
