/**
 * VIZMART - RESPONSIVE LAYOUTS
 *
 * Mobile-first refinements for shared storefront components and pages.
 */

@media (max-width: 1200px) {
  :root {
    --container-max: 1140px;
  }
}

@media (max-width: 1024px) {
  :root {
    --container-max: 960px;
    --header-height: 74px;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .nav-container {
    gap: 12px;
  }

  .hero-floating-card {
    display: none;
  }

  .shop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-layout[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .shop-sidebar {
    position: static;
  }

  .shop-layout:not(.checkout-layout) > div > div[style*="position:sticky"] {
    position: static !important;
  }

  .shop-layout.checkout-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr) !important;
  }
}

@media (max-width: 768px) {
  :root {
    --container-max: 720px;
    --container-pad: 20px;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.85rem;
  }

  .section {
    padding: 50px 0;
  }

  .section-header {
    margin-bottom: 30px;
  }

  .btn {
    min-height: 44px;
    padding: 11px 18px;
    font-size: 0.9rem;
  }

  .slide-drawer {
    width: 100%;
    max-width: 100vw;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-box {
    margin: 0;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 24px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast-alert {
    min-width: 0;
    max-width: none;
  }

  .hero-section {
    padding: 48px 0 56px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero-content {
    align-items: center;
    text-align: center;
  }

  .hero-title {
    font-size: clamp(2.2rem, 8vw, 3rem);
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-trust-badges {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .hero-main-frame img {
    height: clamp(240px, 65vw, 380px);
  }

  .banner-grid {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    gap: 28px;
  }

  .pdp-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    margin-bottom: 44px;
  }

  .pdp-gallery {
    position: static;
  }

  .pdp-info {
    min-width: 0;
  }

  .pdp-purchase-actions {
    align-items: stretch;
  }

  .pdp-add-btn {
    min-width: 0;
  }

  .shop-layout,
  .shop-layout[style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px;
  }

  .checkout-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-top: 24px !important;
    padding-bottom: 48px !important;
  }

  .checkout-form {
    width: 100%;
    min-width: 0;
  }

  .checkout-layout,
  .checkout-details,
  .checkout-order-summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .shop-layout.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px;
  }

  .checkout-layout > .checkout-details,
  .checkout-layout > .checkout-order-summary {
    min-width: 0;
  }

  .checkout-fields {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .checkout-card,
  .checkout-summary-card {
    position: static !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .checkout-form input:not([type="hidden"]),
  .checkout-form textarea,
  .checkout-form select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .checkout-payment-option {
    gap: 10px !important;
    min-width: 0;
    padding: 14px !important;
  }

  .checkout-payment-option > input[type="radio"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    flex: 0 0 18px;
    margin-top: 3px !important;
  }

  .checkout-payment-option > div {
    min-width: 0;
  }

  .checkout-summary-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px;
  }

  .checkout-summary-product {
    min-width: 0;
  }

  .checkout-summary-product img {
    flex: 0 0 38px;
    width: 38px;
  }

  .checkout-summary-product-name {
    overflow-wrap: anywhere;
  }

  .checkout-payment-option strong,
  .checkout-payment-option span {
    overflow-wrap: anywhere;
  }

  .checkout-summary-item > strong {
    white-space: nowrap;
  }

  .checkout-summary-card > div[style*="display:flex"] {
    min-width: 0;
    gap: 8px;
  }

  .checkout-summary-card > div[style*="border-top"] {
    flex-wrap: wrap;
    font-size: clamp(1.05rem, 4vw, 1.35rem) !important;
  }

  .checkout-summary-card button[type="submit"] {
    width: 100%;
    min-height: 48px;
    white-space: normal;
  }

  .shop-toolbar {
    align-items: stretch;
    padding: 14px;
  }

  input:not([type="hidden"]),
  select,
  textarea {
    max-width: 100%;
    min-height: 44px;
  }

  textarea {
    min-height: 96px;
  }

  .sort-select {
    min-height: 44px;
  }

  main form[style*="display:flex"] {
    flex-wrap: wrap;
  }

  main .shop-layout div[style*="80px 1fr auto auto"] {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  main .shop-layout div[style*="80px 1fr auto auto"] img {
    width: 64px !important;
    height: 64px !important;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .product-info {
    padding: 14px;
  }

  .product-title {
    font-size: 0.96rem;
  }

  .product-pricing {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .price-current {
    font-size: 1.15rem;
  }

  .quick-add-btn {
    min-height: 44px;
    padding: 9px 10px;
  }

  .filter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 24px;
  }
}

@media (max-width: 576px) {
  :root {
    --container-pad: 16px;
  }

  html {
    font-size: 15px;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.4rem);
  }

  h2 {
    font-size: clamp(1.65rem, 7vw, 1.85rem);
  }

  .announcement-bar {
    padding: 7px 12px;
    font-size: 0.72rem;
  }

  .announcement-ticker {
    height: 2.8em;
    min-height: 22px;
  }

  .ticker-item {
    gap: 6px;
    line-height: 1.35;
  }

  .ticker-item svg {
    flex: 0 0 14px;
  }

  .site-header,
  .site-header.scrolled {
    padding: 9px 0;
  }

  .nav-container {
    gap: 8px;
  }

  .brand-logo {
    gap: 7px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .brand-text {
    min-width: 0;
  }

  .pdp-info > div:first-child {
    flex-wrap: wrap;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .brand-subtitle {
    font-size: 0.56rem;
    letter-spacing: 0.08em;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .header-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .action-btn {
    width: 36px;
    height: 36px;
  }

  .action-btn svg {
    width: 17px;
    height: 17px;
  }

  .hero-section {
    padding: 40px 0 48px;
  }

  .hero-content {
    gap: 16px;
  }

  .hero-tag {
    max-width: 100%;
    font-size: 0.74rem;
    padding: 6px 12px;
  }

  .hero-title {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-trust-badges {
    width: 100%;
    padding-top: 18px;
  }

  .trust-item {
    font-size: 0.78rem;
  }

  .hero-main-frame img {
    height: clamp(220px, 72vw, 320px);
  }

  .categories-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .category-card {
    height: clamp(260px, 72vw, 340px);
    padding: 22px;
  }

  .products-grid {
    gap: 10px;
  }

  .product-info {
    padding: 10px;
  }

  .product-category {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
  }

  .product-title {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .product-rating {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.72rem;
  }

  .review-count {
    font-size: 0.68rem;
  }

  .product-pricing {
    margin-bottom: 10px;
  }

  .price-current {
    font-size: 1rem;
  }

  .price-original {
    font-size: 0.75rem;
  }

  .price-discount {
    font-size: 0.65rem;
    padding: 2px 5px;
  }

  .product-badge {
    top: 8px;
    left: 8px;
    font-size: 0.6rem;
    padding: 3px 7px;
  }

  .card-actions {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .card-action-btn {
    width: 32px;
    height: 32px;
  }

  .card-action-btn svg {
    width: 15px;
    height: 15px;
  }

  .quick-add-btn {
    min-height: 44px;
    font-size: 0.75rem;
    gap: 5px;
  }

  .quick-add-btn svg {
    width: 14px;
    height: 14px;
  }

  .countdown-box {
    padding: 24px 12px;
  }

  .countdown-timer {
    gap: 6px;
  }

  .timer-unit {
    min-width: 0;
    flex: 1;
    padding: 10px 4px;
  }

  .timer-num {
    font-size: 1.45rem;
  }

  .timer-txt {
    font-size: 0.6rem;
  }

  .testimonial-card {
    padding: 22px;
  }

  .newsletter-card {
    padding: 36px 20px;
  }

  .newsletter-card p {
    font-size: 0.95rem;
    margin-bottom: 22px;
  }

  .newsletter-form {
    flex-direction: column;
    border-radius: var(--border-radius-lg);
    background: transparent;
    padding: 0;
    gap: 12px;
  }

  .newsletter-input {
    width: 100%;
    min-height: 46px;
    background: #FFFFFF;
    border-radius: var(--border-radius-md);
  }

  .newsletter-form .btn {
    width: 100%;
    border-radius: var(--border-radius-md);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    margin-bottom: 36px;
  }

  .site-footer {
    padding: 52px 0 24px;
  }

  .footer-brand p {
    max-width: none;
  }

  .pdp-grid {
    margin-top: 16px;
    gap: 22px;
  }

  .pdp-main-image-box {
    border-radius: var(--border-radius-lg);
  }

  .pdp-info {
    gap: 16px;
  }

  .pdp-title {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .pdp-price-box {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .pdp-current-price {
    font-size: 1.8rem;
  }

  .pdp-original-price {
    font-size: 1rem;
  }

  .pdp-purchase-actions {
    gap: 10px;
  }

  .pdp-add-btn {
    flex-basis: 100%;
  }

  .pdp-thumbnails {
    gap: 8px;
  }

  main table:not(.pdp-specs-table) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .pdp-thumb {
    width: 64px;
    height: 64px;
  }

  .pdp-breadcrumbs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
  }

  .shop-sidebar {
    padding: 16px;
  }

  .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  main form [style*="display:grid"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .checkout-card {
    padding: 20px !important;
  }

  main .shop-layout div[style*="80px 1fr auto auto"] img {
    width: 56px !important;
    height: 56px !important;
  }

  main .shop-layout > div > div[style*="border-radius:var(--border-radius-xl)"] {
    padding: 16px !important;
  }

  .sort-select {
    width: 100%;
  }

  .modal-box {
    padding: 20px 16px;
    border-radius: var(--border-radius-lg);
  }

  .mobile-nav-drawer {
    width: min(320px, 88vw);
    max-width: 88vw;
    height: 100dvh;
    padding: 20px;
  }

  .search-input-wrapper {
    padding: 10px 12px !important;
  }

  .search-chips {
    gap: 6px !important;
  }
}

@media (max-width: 375px) {
  :root {
    --container-pad: 16px;
  }

  .brand-title {
    font-size: 1.08rem;
  }

  .brand-subtitle {
    display: none;
  }

  .action-btn {
    width: 32px;
    height: 32px;
  }

  .header-actions {
    gap: 3px;
  }

  .announcement-bar {
    font-size: 0.68rem;
  }

  .product-info {
    padding: 9px;
  }

  .products-grid {
    gap: 8px;
  }

  .quick-add-btn {
    font-size: 0.7rem;
  }

  .pdp-purchase-actions .qty-control {
    flex: 0 0 auto;
  }

  .pdp-purchase-actions .pdp-add-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 340px) {
  .brand-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .brand-logo {
    gap: 5px;
  }

  .header-actions {
    gap: 2px;
  }

  .action-btn {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 768px) {
  .site-footer {
    display: none;
  }

  .product-card {
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  }

  .mobile-menu-btn svg {
    transition: transform var(--transition-normal);
  }

  .mobile-menu-btn[aria-expanded="true"] svg {
    transform: rotate(90deg);
  }
}

@media (min-width: 700px) and (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (hover: none) {
  .product-card:hover,
  .category-card:hover {
    transform: none;
  }

  .product-card:hover .product-img,
  .category-card:hover .category-img {
    transform: none;
  }

  .product-card:active,
  .category-card:active {
    transform: scale(0.99);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
