/* ===== MOBILE STYLES (768px and below) ===== */
@media (max-width: 768px) {
  #product-carousel .card.center .product-meta .product-name {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.3);
    color: var(--color-dark);
  }

  .mobile-home-link {
    display: block;
  }

  /* Hide the desktop navigation bar but keep the mobile popup */
  .center-nav:not(.active) {
    display: none;
  }

  /* Use logo as mobile menu toggle on the left */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: -2px;
    left: 15px;
    z-index: 1002;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 10px;
    transition: all var(--transition-normal);
    transform: translateY(0) !important;
  }

  .menu-logo img {
    width: 30vw;
  }

  .mobile-menu-toggle.active {
    background: rgba(108, 92, 231, 0.2);
  }

  .mobile-menu-toggle img {
    height: 9vh;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }

  .mobile-menu-toggle.active img {
    transform: rotate(180deg);
  }

  .mobile-menu-toggle:hover img {
    transform: scale(1.1);
  }

  .mobile-menu-toggle.active:hover img {
    transform: rotate(180deg);
  }

  /* Hide the desktop logo since we're using it as menu toggle */
  .header-top .logo-button {
    display: none;
  }

  /* Mobile nav links */
  .center-nav.active ul {
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    text-align: center;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .center-nav.active li {
    width: 100%;
  }

  .center-nav.active li a {
    font-size: 2.5rem;
    padding: var(--space-lg) var(--space-xl);
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
    transition: all var(--transition-normal);
    border-radius: 15px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
  }

  .center-nav.active li a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
  }

  .theme-toggle button {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .theme-toggle button:hover {
    background: var(--color-secondary);
    transform: scale(1.1);
  }

  /* Adjust main content to account for sticky cart */
  main.container {
    margin-top: 0;
  }

  /* CART STICKY BEHAVIOR - Mobile specific positions */
  .cart-indicator {
    top: 90px;
    right: 15px;
    padding: 8px 12px;
    font-size: 1rem;
    max-width: 140px;
  }

  .cart-indicator.sticky {
    top: 12px;
    font-size: 1.2rem;
  }

  footer {
    margin-top: 1vh;
  }
}

.order-section {
  max-width: 90%;
  margin: 7vw;
}

/* ===== TABLET STYLES (769px to 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Show desktop navigation in tablet view */
  .center-nav:not(.active) {
    display: flex !important;
  }

  /* Hide mobile menu toggle in tablet view */
  .mobile-menu-toggle {
    display: none !important;
  }

  /* Show desktop logo in tablet view */
  .header-top .logo-button {
    display: block !important;
  }

  .theme-toggle button {
    background: none !important;
    border: none !important;
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.3rem !important;
    color: var(--text-primary) !important;
    transition: all var(--transition-normal) !important;
  }

  .theme-toggle button:hover {
    background: rgba(108, 92, 231, 0.1) !important;
    transform: scale(1.1) !important;
  }

  /* Cart positioning for tablet */
  .cart-indicator {
    top: 100px;
    right: 20px;
    padding: 10px 15px;
    max-width: 160px;
    z-index: 1002;
    font-size: 1rem;
  }

  .cart-indicator.sticky {
    top: 15px;
    font-size: 1rem;
  }
}

/* ===== SMALLER MOBILE BREAKPOINTS ===== */
@media (max-width: 550px) {
  .hero-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-med);
    margin-top: var(--space-sm) 0;
    margin-bottom: 0;
    align-items: start;
  }

  .hero-card {
    font-family: "Comic Neue", cursive, sans-serif;
    margin-left: 5%;
    margin-right: 5%;
    background: var(--color-light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal);
    width: 90%;
  }

  [class~="2"] {
    margin-top: 2%;
  }

  .hero-content h2,
  .hero-content p {
    display: none;
  }

  main.container {
    margin-top: 65px;
  }

  /* Cart adjustments */
  .cart-indicator {
    top: 80px;
    right: 12px;
    padding: 6px 10px;
    max-width: 130px;
  }

  .cart-indicator.sticky {
    top: 10px;
    right: 0;
  }
}

@media (max-width: 420px) {
  .mobile-menu-toggle {
    top: 8px;
    left: 8px;
  }

  main.container {
    margin-top: 5dvh;
  }

  /* Cart adjustments */
  .cart-indicator {
    top: 70px;
    right: 10px;
    padding: 5px 8px;
    font-size: 1rem;
    max-width: 120px;
  }

  .nav-arrow.left {
    left: var(--space-sm);
    padding-right: 3px;
  }

  .nav-arrow.right {
    right: var(--space-sm);
    padding-left: 3px;
  }

  .email-form-section {
    top: 5dvh;
  }
}

@media (max-width: 375px) {
  body.puppy-page .main.container,
  body.EmailFormPage .main.container {
    margin-top: 0 !important;
  }
  body.puppy-page .mobile-menu-toggle,
  body.EmailFormPage .mobile-menu-toggle,
  body.main .mobile-menu-toggle {
    top: -9px !important;
  }
  .cart-indicator {
    top: 15px;
    right: 30vw;
    font-size: 1.25rem;
  }

  body.our-stickers-page .main.container,
  body.EmailFormPage .main.container {
    margin-top: 0 !important;
  }
  .mobile-menu-toggle {
    top: -9px !important;
  }

  .cart-indicator.sticky {
    top: 3vh !important;
    right: 0;
    transition: all ease-in-out;
  }
  .cart-dropdown {
    right: -30vw;
    max-height: 90vh;
    max-width: 35vw;
  }
  .cart-indicator.sticky .cart-dropdown {
    right: 0;
  }

  body.our-stickers-page .theme-toggle-container {
    right: 55px !important;
  }
  body.EmailFormPage .cart-indicator {
    right: 85px !important;
  }
}

/* ===== DESKTOP STYLES (1025px and above) - COMPLETE RESET ===== */
@media (min-width: 1025px) {
  /* Completely disable mobile menu system */
  .mobile-menu-toggle {
    display: none;
    pointer-events: none;
  }

  .mobile-home-link {
    display: none !important;
  }

  .mobile-menu-backdrop {
    display: none;
    pointer-events: none;
  }

  /* Reset header structure */
  header {
    background: var(--color-light);
    box-shadow: var(--shadow-sm);
    height: 100px;
    position: sticky;
    top: 0;
  }

  .header-content {
    display: flex;
    flex-direction: column;
    height: 100px;
  }

  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    padding: 0;
  }
  .header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100px;
    padding: 0;
  }

  /* Ensure desktop logo is visible */
  .header-top .logo-button {
    display: block;
    height: 80px;
  }

  .header-top .logo-button img {
    height: 80px;
    width: auto;
  }

  /* Reset center-nav to desktop state */
  .center-nav {
    display: flex;
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    width: 100%;
    height: 30px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    margin-top: auto;
    padding-bottom: 10px;
    animation: none;
    justify-content: center;
    align-items: flex-end;
  }

  .center-nav.active,
  .center-nav:not(.active) {
    animation: none;
    transform: none;
  }

  /* Reset nav links to desktop */
  .center-nav ul {
    display: flex;
    flex-direction: row;
    gap: var(--space-xl);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .center-nav li {
    width: auto;
    height: auto;
  }

  .center-nav li a {
    font-size: 2.1rem;
    padding: var(--space-sm) var(--space-md);
    display: inline-block;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    width: auto;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
  }

  .center-nav li a:hover {
    background: transparent;
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: none;
  }

  /* Reset theme toggle for desktop */
  .theme-toggle button {
    background: none;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    box-shadow: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-primary);
    transition: all var(--transition-normal);
  }

  .theme-toggle button:hover {
    background: rgba(108, 92, 231, 0.1);
    transform: scale(1.1);
  }

  /* Reset main content margin */
  main.container {
    margin-top: 0;
  }

  /* Desktop cart sticky behavior */
  .cart-indicator.sticky {
    top: 20px;
    font-size: 1rem !important;
  }
}

/* ===== MOBILE MENU ANIMATION ===== */
@keyframes slideInBounce {
  0% {
    opacity: 0;
    transform: translateX(-50%) perspective(1200px) rotateX(-95deg) scale(0.7);
    filter: blur(15px);
  }
  40% {
    opacity: 0.8;
    transform: translateX(-50%) perspective(1200px) rotateX(45deg) scale(1.1);
    filter: blur(5px);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) perspective(1200px) rotateX(-15deg) scale(0.95);
    filter: blur(2px);
  }
  80% {
    transform: translateX(-50%) perspective(1200px) rotateX(8deg) scale(1.02);
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) perspective(1200px) rotateX(0deg) scale(1);
    filter: blur(0px);
  }
}

@keyframes menuSlideOut {
  0% {
    opacity: 1;
    transform: translateX(-50%) perspective(1200px) rotateX(0deg) scale(1);
    filter: blur(0px);
  }
  20% {
    transform: translateX(-50%) perspective(1200px) rotateX(-25deg) scale(1.05);
    filter: blur(2px);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) perspective(1200px) rotateX(65deg) scale(0.9);
    filter: blur(8px);
  }
  80% {
    opacity: 0.3;
    transform: translateX(-50%) perspective(1200px) rotateX(85deg) scale(0.8);
    filter: blur(12px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) perspective(1200px) rotateX(95deg) scale(0.7);
    filter: blur(15px);
  }
}
