/* ============================================================
   Prime1mg Pharmacy - Responsive Breakpoints
   BEM Class Names Matching HTML
   ============================================================ */

/* === LARGE SCREENS (max-width: 1024px) === */
@media (max-width: 1024px) {
  .bw-container {
    padding: 0 16px;
  }

  .bw-navbar__search {
    max-width: 360px;
  }

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

  .bw-footer__grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 30px;
  }

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

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

  .bw-product-detail {
    grid-template-columns: 50% 50%;
    gap: 28px;
  }

  .bw-cart-layout {
    grid-template-columns: 1fr 320px;
    gap: 24px;
  }

  .bw-section {
    padding: 36px 0;
  }

  .bw-section-alt {
    padding: 36px 0;
  }

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

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

  /* Listing layout */
  .bw-listing-layout {
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
  }

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

  /* Blog layout */
  .bw-blog-layout {
    grid-template-columns: 1fr 280px;
  }

  /* Contact layout */
  .bw-contact-layout {
    gap: 2rem;
  }

  /* Article */
  .bw-article-title {
    font-size: 1.75rem;
  }
}


/* === TABLET (max-width: 768px) === */
@media (max-width: 768px) {
  :root {
    --bw-navbar-height: 56px;
  }

  /* Hide top bar on mobile */
  .bw-topbar {
    display: none;
  }

  /* Navbar adjustments */
  .bw-navbar__inner {
    gap: 12px;
  }

  .bw-navbar__search {
    display: none;
  }

  .bw-navbar__actions {
    display: none;
  }

  .bw-navbar__mobile-actions {
    display: flex;
  }

  /* Mobile bottom nav bar */
  .bw-mobile-bottom-nav {
    display: flex;
  }

  /* Add bottom padding so content isn't hidden behind bottom nav */
  .bw-main {
    padding-bottom: 60px;
  }

  .bw-footer {
    padding-bottom: 60px;
  }

  /* Keep back-to-top above bottom nav */
  .bw-back-to-top {
    bottom: 72px;
  }

  /* Keep toast above bottom nav */
  .bw-toast {
    bottom: 72px;
  }

  .bw-navbar__mobile-search {
    display: block;
  }

  .bw-navbar__action-label {
    display: none;
  }

  /* Category nav hidden on mobile */
  .bw-catnav {
    display: none;
  }

  /* Product grid - 2 columns */
  .bw-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Mobile scroll for product sections */
  .bw-scroll-mobile {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
  }

  .bw-scroll-mobile .bw-product-card {
    flex: 0 0 calc(50% - 6px);
    min-width: calc(50% - 6px);
    scroll-snap-align: start;
  }

  /* Section headers */
  .bw-section-title {
    font-size: 1.25rem;
  }

  .bw-section {
    padding: 28px 0;
  }

  .bw-section-alt {
    padding: 28px 0;
  }

  .bw-section-header {
    margin-bottom: 16px;
  }

  /* Hero */
  .bw-carousel-img {
    max-height: 260px;
    border-radius: var(--bw-radius-sm);
  }

  .bw-carousel-prev,
  .bw-carousel-next {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .bw-carousel-title {
    font-size: 22px;
  }

  .bw-carousel-subtitle {
    font-size: 14px;
  }

  .bw-carousel-overlay {
    padding: 20px;
  }

  /* Category scroll */
  .bw-category-icon-wrap {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }

  .bw-category-label {
    font-size: 12px;
  }

  .bw-category-circle {
    width: 90px;
  }

  /* Product card mobile adjustments */
  .bw-product-img {
    min-height: 140px;
  }

  .bw-product-img img {
    max-height: 140px;
  }

  .bw-product-name {
    font-size: 13px;
  }

  .bw-product-card {
    padding: 12px;
  }

  /* Product detail */
  .bw-product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .bw-pd-gallery {
    position: static;
  }

  .bw-pd-gallery--multi {
    flex-direction: column-reverse;
  }

  .bw-pd-thumbs-col {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    padding-bottom: 4px;
  }

  .bw-pd-thumb {
    width: 56px;
    height: 56px;
  }

  .bw-pd-main-img {
    min-height: 280px;
  }

  .bw-pd-main-img img {
    max-height: 300px;
  }

  .bw-pd-img-nav {
    opacity: 1;
  }

  .bw-pd-zoom-btn {
    opacity: 1;
  }

  .bw-pd-name {
    font-size: 20px;
  }

  .bw-pd-price {
    font-size: 24px;
  }

  /* Cart */
  .bw-cart-layout {
    grid-template-columns: 1fr;
  }

  .bw-cart-summary {
    position: static;
  }

  .bw-cart-item__img {
    width: 70px;
    height: 70px;
  }

  /* Trust grid */
  .bw-trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .bw-trust-card {
    padding: 20px 16px;
  }

  .bw-trust-icon {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  /* Footer */
  .bw-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 24px;
  }

  .bw-footer__main {
    padding: 40px 0 24px;
  }

  .bw-footer__bottom-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  /* Listing page */
  .bw-listing-layout {
    grid-template-columns: 1fr;
  }

  .bw-filter-toggle {
    display: flex;
  }

  .bw-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    border-radius: 0;
    overflow-y: auto;
    padding: 1.5rem;
  }

  .bw-sidebar.bw-open {
    display: block;
  }

  .bw-sidebar-close {
    display: block;
  }

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

  /* Blog layout */
  .bw-blog-layout {
    grid-template-columns: 1fr;
  }

  .bw-blog-sidebar {
    position: static;
  }

  /* Blog */
  .bw-blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bw-blog-img {
    height: 170px;
  }

  .bw-blog-card__image {
    height: 170px;
  }

  /* Contact */
  .bw-contact-layout {
    grid-template-columns: 1fr;
  }

  /* Article */
  .bw-article-title {
    font-size: 1.4rem;
  }

  .bw-article-meta {
    gap: 0.75rem;
  }

  /* Search */
  .bw-search-inline {
    flex-direction: column;
  }

  .bw-search-inline .bw-input {
    border-radius: var(--bw-radius-sm);
    border-right: 1px solid var(--bw-border);
  }

  .bw-search-inline .bw-btn {
    border-radius: var(--bw-radius-sm);
  }

  /* Product detail info nav - handled in style.css media query */

  .bw-pd-cart-section {
    flex-direction: column;
  }

  .bw-btn-cart-main,
  .bw-btn-buy {
    width: 100%;
  }

  /* Form row */
  .bw-form-row {
    grid-template-columns: 1fr;
  }

  /* Promo */
  .bw-promo-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bw-promo-card img {
    height: 160px;
  }

  /* Tabs */
  .bw-tab-nav {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bw-tab-nav::-webkit-scrollbar {
    display: none;
  }

  .bw-tab-btn {
    padding: 10px 18px;
    font-size: 13px;
  }

  /* Reviews */
  .bw-review-summary {
    flex-direction: column;
    align-items: center;
  }

  .bw-review-avg {
    min-width: auto;
  }

  /* Auth */
  .bw-auth-card {
    padding: 28px 24px;
  }

  /* Mega menu */
  .bw-mega-menu__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Pagination */
  .bw-page-btn {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
  }

  /* Toast & flash */
  .bw-flash-container {
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .bw-toast {
    right: 16px;
    left: 16px;
    bottom: 16px;
  }

  /* Headings */
  h1 {
    font-size: 1.625rem;
  }

  h2 {
    font-size: 1.375rem;
  }

  /* Dropdown */
  .bw-dropdown__menu {
    min-width: 180px;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 12px;
    padding: 12px 0;
  }

  /* Mobile drawer wider */
  .bw-mobile-drawer__panel {
    width: 280px;
  }
}


/* === MOBILE (max-width: 480px) === */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .bw-container {
    padding: 0 12px;
  }

  /* Product grids */
  .bw-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .bw-scroll-mobile .bw-product-card {
    flex: 0 0 calc(50% - 5px);
    min-width: calc(50% - 5px);
  }

  /* Section */
  .bw-section,
  .bw-section-alt {
    padding: 20px 0;
  }

  .bw-section-header {
    margin-bottom: 12px;
  }

  .bw-section-title {
    font-size: 1.125rem;
  }

  .bw-view-all {
    font-size: 13px;
  }

  /* Navbar */
  .bw-navbar__logo-text {
    font-size: 20px;
  }

  /* Hero */
  .bw-carousel-img {
    max-height: 180px;
  }

  .bw-carousel-prev,
  .bw-carousel-next {
    display: none;
  }

  .bw-carousel-title {
    font-size: 18px;
  }

  .bw-carousel-subtitle {
    font-size: 13px;
  }

  .bw-carousel-overlay {
    padding: 16px;
  }

  /* Category */
  .bw-category-scroll {
    gap: 14px;
  }

  .bw-category-icon-wrap {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }

  .bw-category-label {
    font-size: 11px;
    max-width: 70px;
  }

  .bw-category-circle {
    width: 75px;
  }

  /* Product cards */
  .bw-product-img {
    min-height: 120px;
  }

  .bw-product-img img {
    max-height: 120px;
  }

  .bw-product-card {
    padding: 10px;
  }

  .bw-product-brand {
    font-size: 10px;
  }

  .bw-product-name {
    font-size: 12px;
  }

  .bw-product-pack {
    font-size: 11px;
  }

  .bw-price {
    font-size: 15px;
  }

  .bw-mrp {
    font-size: 12px;
  }

  .bw-discount-text {
    font-size: 11px;
  }

  .bw-badge {
    font-size: 10px;
    padding: 2px 8px;
  }

  .bw-wishlist-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .bw-btn-cart {
    padding: 8px;
    font-size: 13px;
  }

  .bw-btn-disabled {
    padding: 8px;
    font-size: 13px;
  }

  .bw-rating-badge {
    font-size: 11px;
    padding: 1px 6px;
  }

  /* PDP */
  .bw-pd-name {
    font-size: 18px;
  }

  .bw-pd-price {
    font-size: 22px;
  }

  .bw-pd-thumb {
    width: 52px;
    height: 52px;
  }

  .bw-pd-actions {
    flex-direction: column;
  }

  .bw-pd-actions .bw-btn {
    width: 100%;
  }

  .bw-pd-main-img {
    min-height: 220px;
  }

  .bw-pd-main-img img {
    max-height: 300px;
  }

  .bw-pd-price-block {
    padding: 16px;
  }

  /* Cart */
  .bw-cart-item {
    flex-wrap: wrap;
    padding: 16px;
  }

  .bw-cart-item__img {
    width: 70px;
    height: 70px;
  }

  .bw-cart-item__total {
    min-width: auto;
  }

  /* Trust */
  .bw-trust-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .bw-trust-card {
    padding: 16px 12px;
  }

  .bw-trust-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
    margin-bottom: 10px;
  }

  .bw-trust-title {
    font-size: 13px;
  }

  .bw-trust-text {
    font-size: 12px;
  }

  /* Footer */
  .bw-footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .bw-footer__payments {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Blog */
  .bw-blog-img {
    height: 160px;
  }

  .bw-blog-body {
    padding: 14px;
  }

  .bw-blog-title {
    font-size: 15px;
  }

  .bw-blog-card__image {
    height: 160px;
  }

  .bw-blog-card__body {
    padding: 14px;
  }

  .bw-blog-card__title {
    font-size: 15px;
  }

  /* Buttons - touch friendly */
  .bw-btn {
    min-height: 44px;
  }

  .bw-btn-sm {
    min-height: 38px;
  }

  /* Forms - touch friendly, prevents iOS zoom */
  .bw-input {
    height: 46px;
    font-size: 16px;
  }

  /* Back to top */
  .bw-back-to-top {
    width: 40px;
    height: 40px;
    bottom: 16px;
    right: 16px;
    font-size: 14px;
  }

  /* Mobile drawer full width */
  .bw-mobile-drawer__panel {
    width: 85vw;
    max-width: 320px;
  }

  .bw-mobile-drawer__nav li a {
    padding: 14px 20px;
    min-height: 48px;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 11px;
    padding: 10px 0;
  }

  /* Pagination */
  .bw-pagination {
    gap: 4px;
    margin-top: 20px;
  }

  .bw-page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }

  /* Auth */
  .bw-auth {
    padding: 20px 12px;
  }

  .bw-auth-card {
    padding: 24px 20px;
  }

  .bw-auth-card__title {
    font-size: 20px;
  }

  /* Headings */
  h1 {
    font-size: 1.375rem;
  }

  h2 {
    font-size: 1.1875rem;
  }

  h3 {
    font-size: 1.0625rem;
  }
}


/* === VERY SMALL SCREENS (max-width: 360px) === */
@media (max-width: 360px) {
  .bw-product-grid {
    gap: 8px;
  }

  .bw-product-card {
    padding: 8px;
  }

  .bw-product-img {
    min-height: 100px;
  }

  .bw-product-img img {
    max-height: 100px;
  }

  .bw-category-scroll {
    gap: 10px;
  }

  .bw-category-circle {
    width: 65px;
  }

  .bw-category-icon-wrap {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .bw-promo-card img {
    height: 120px;
  }
}


/* === PRINT === */
@media print {

  .bw-topbar,
  .bw-navbar,
  .bw-catnav,
  .bw-back-to-top,
  .bw-flash-container,
  .bw-toast,
  .bw-footer,
  .bw-mobile-drawer,
  .bw-mobile-bottom-nav {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
  }

  .bw-card,
  .bw-product-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .bw-section,
  .bw-section-alt {
    padding: 16px 0;
  }
}