/* =============================================
   TALHA STUDIO - Responsive Design
   ============================================= */

/* ----- LAPTOP (1024px - 1440px) ----- */
@media (max-width: 1200px) {
  .product-grid {
    gap: 0;
  }
  
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----- TABLET (768px - 1024px) ----- */
@media (max-width: 1024px) {
  :root {
    --header-height: 70px;
  }

  .product-grid {
    gap: 0;
  }

  .category-grid {
    gap: 0;
  }

  .testimonials-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .hero-content h1 {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  .nav-menu {
    gap: 1.25rem;
  }

  .mega-menu {
    min-width: 500px;
  }
}

/* ----- TABLET & MOBILE (below 992px) ----- */
@media (max-width: 992px) {
  .hamburger-menu {
    display: flex !important;
    order: -1;
  }

  .header-inner {
    position: relative;
  }

  .header-inner > .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    justify-content: center;
  }

  .header-actions {
    margin-left: auto;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 0;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    border-right: 1px solid #eee;
    z-index: 2000;
  }

  .nav-menu.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #000;
    font-size: 1.25rem;
    transition: background 0.2s;
  }
  .mobile-menu-close:hover { background: #e0e0e0; }

  .nav-link {
    display: block;
    width: 100%;
    padding: 1rem 0;
    font-size: 1rem;
    color: #000;
    border-bottom: 1px solid #eee;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--accent);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .mobile-menu-auth {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
  }

  .mega-menu {
    position: static;
    transform: none;
    min-width: auto;
    box-shadow: none;
    padding: 1rem;
    border: none;
    background: var(--bg-secondary);
    margin-top: 0.5rem;
    display: none;
  }

  .mega-menu.open {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero {
    min-height: 80vh;
  }

  .hero-arrows {
    display: none;
  }

  .sale-timer {
    gap: 1rem;
  }

  .timer-number {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
  }

  .quick-view-grid {
    grid-template-columns: 1fr;
  }

  .product-card-actions {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ----- MOBILE (576px - 768px) ----- */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .section {
    padding: 3rem 0;
  }

  h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
  h2 { font-size: clamp(1.5rem, 4vw, 2rem); }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

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

  .hero-content p {
    margin: 0 auto 2rem;
  }

  .hero-content .btn {
    margin: 0 auto;
  }

  .product-grid {
    gap: 0;
  }

  .product-card {
    flex: 0 0 75%;
  }

  .product-grid-shop {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    padding: 0;
  }

  .product-grid-shop .product-card {
    border: none;
    border-radius: 0;
    overflow: hidden;
  }

  .product-card-body {
    padding: 0.875rem;
  }

  .product-card-title {
    font-size: 0.875rem;
  }

  .product-card-category {
    font-size: 0.6rem;
  }

  .current-price {
    font-size: 1rem;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .footer {
    padding: 3rem 0 0;
  }

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

  .newsletter-form {
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .newsletter-form input {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .newsletter-form button {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }

  .page-header {
    padding: 6rem 0 2rem;
  }

  .toast {
    min-width: auto;
    max-width: 90vw;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
  }

  .header-inner {
    height: var(--header-height);
    padding: 0 1.25rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-action-btn {
    width: 36px;
    height: 36px;
  }
}

/* ----- SMALL MOBILE (below 576px) ----- */
@media (max-width: 576px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .product-grid {
    gap: 0;
  }

  .product-card {
    flex: 0 0 75%;
  }

  .product-grid-shop {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    padding: 0;
    max-width: 100%;
  }

  .product-grid-shop .product-card {
    width: 100%;
    border: none;
    border-radius: 0;
    overflow: hidden;
  }

  .category-grid {
    gap: 0;
  }

  .category-card {
    flex: 0 0 65%;
  }

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

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

  .sale-timer {
    gap: 0.75rem;
  }

  .timer-number {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .modal {
    padding: 1.5rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo img {
    height: 30px;
  }

  .breadcrumb {
    font-size: 0.75rem;
    padding: 1rem 0;
  }
}

/* ----- LANDSCAPE MODE ----- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 120vh;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-content p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }

  .nav-menu {
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }
}

/* ----- HAMBURGER MENU ----- */

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-normal);
  border-radius: 2px;
}

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

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

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

/* ----- CART DRAWER MOBILE ----- */
@media (max-width: 576px) {
  .cart-drawer {
    width: 100vw;
    max-width: 100vw;
  }
  .cart-drawer-header {
    padding: 16px 18px;
  }
  .cart-drawer-body {
    padding: 12px 18px;
  }
  .cart-drawer-footer {
    padding: 16px 18px;
  }
  .cart-drawer-item-img {
    width: 65px;
    height: 80px;
  }
}

/* ----- MOBILE BOTTOM BAR ----- */
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 992px) {
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    justify-content: space-evenly;
    align-items: center;
    height: 64px;
    padding: 0 0.25rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
  }

  .mobile-bottom-bar.visible {
    transform: translateY(0);
  }

  .mobile-bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 48px;
  }

  .mobile-bottom-bar-item .header-action-btn {
    color: var(--text-primary);
  }

  .mobile-bottom-bar-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1;
  }

  body {
    padding-bottom: 64px;
  }

  .header-actions .theme-toggle,
  .header-actions [aria-label="Wishlist"],
  .header-actions .auth-link {
    display: none !important;
  }
}

/* ----- PRINt ----- */
@media print {
  .hamburger-menu { display: none !important; }
  .nav-menu { position: static; transform: none; opacity: 1; visibility: visible; }
  .hero { min-height: auto; }
  .mobile-bottom-bar { display: none !important; }
}
