/* =============================================================
   Pragya Homoeopathic Clinic — Responsive Design System
   Optimised for Mobile (320px - 767px), Tablet (768px - 1023px)
   and Desktop (1024px+)
   ============================================================= */

/* ---------- GLOBAL MOBILE SAFETY (PREVENT HORIZONTAL DRIFT) ---------- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Touch-friendly defaults */
@media (max-width: 768px) {
  .btn, .nav-link, .form-input, .form-select, .form-textarea {
    min-height: 44px;
  }
  .btn--sm { min-height: 38px; }
  .nav-link { padding: .75rem .25rem; }
}

/* ---------- TABLET / MOBILE NAVIGATION (under 1024px) ---------- */
@media (max-width: 1023px) {
  :root {
    --header-height: 70px;
  }
  .main-nav { display: none; }
  .header-cta .btn--red { display: none; }
  .hamburger { display: flex; }
  .btn-whatsapp { display: none; }

  .site-header__inner {
    height: var(--header-height);
  }
  .logo img {
    height: 44px;
    width: auto;
    max-width: 185px;
  }

  .mobile-menu {
    top: var(--header-height);
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
    -webkit-overflow-scrolling: touch;
  }
  .mobile-menu__inner {
    padding: 1.25rem 1.25rem 2.5rem;
    gap: .25rem;
  }
  .mobile-menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .95rem .25rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--pragya-dark);
    border-bottom: 1px solid #edf0f5;
  }
  .mobile-menu__link::after {
    content: '›';
    font-size: 1.4rem;
    color: var(--pragya-cyan);
    font-weight: 400;
    line-height: 1;
  }
  .mobile-menu__link:hover,
  .mobile-menu__link.is-active {
    color: var(--pragya-blue);
  }
  .mobile-menu__contact {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--pragya-cyan-light);
    border-radius: var(--radius-md);
  }

  /* Shop Layout on Tablet/Mobile */
  .shop-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .shop-sidebar {
    position: static;
  }
  .shop-cat-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: .5rem;
    padding: .25rem 0 .75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .shop-cat-list li {
    flex-shrink: 0;
    border-bottom: none;
    padding: 0;
  }
  .shop-cat-list a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    background: var(--pragya-light);
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: .85rem;
    white-space: nowrap;
  }
  .shop-cat-list a.is-active {
    background: var(--pragya-blue);
    color: #fff;
    border-color: var(--pragya-blue);
  }
  .shop-cat-count {
    background: rgba(0,0,0,.08);
  }
  .shop-cat-list a.is-active .shop-cat-count {
    background: rgba(255,255,255,.25);
    color: #fff;
  }
}

/* ---------- SMARTPHONE & MOBILE SCREENS (under 768px) ---------- */
@media (max-width: 767px) {
  :root {
    --header-height: 64px;
  }

  /* Top Bar */
  .top-bar { padding: .35rem 0; font-size: .8rem; }
  .top-bar__inner { gap: .5rem; }
  .top-bar__announce { font-size: .76rem; }
  .top-bar__link { font-size: .78rem; }

  /* Header */
  .logo img { height: 38px; max-width: 160px; }
  .btn-cart { width: 38px; height: 38px; }
  .hamburger { width: 34px; height: 34px; }

  /* Hero Section */
  .hero {
    min-height: auto;
    padding: 2.75rem 0 3.25rem;
    background-size: cover;
    background-position: center center;
  }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero__eyebrow {
    font-size: .78rem;
    letter-spacing: .12em;
    margin-bottom: .65rem;
  }
  .hero__title {
    font-size: clamp(1.85rem, 7.5vw, 2.35rem);
    line-height: 1.18;
    margin-bottom: 1rem;
  }
  .hero__title br {
    display: none; /* prevent unnatural desktop breaks on small phone screens */
  }
  .hero__lead {
    font-size: .98rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  .hero__cta {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }
  .hero__cta .btn {
    width: 100%;
    text-align: center;
  }

  /* Quick Appointment Hero Card */
  .hero__card {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-md);
  }
  .hero__card-title {
    font-size: 1.2rem;
  }
  .hero__card-text {
    font-size: .88rem;
    margin-bottom: .85rem;
  }
  .hero__card-meta {
    gap: 1rem;
    justify-content: space-around;
  }
  .hero__card-meta strong {
    font-size: 1.4rem;
  }
  .hero__card-meta span {
    font-size: .75rem;
  }

  /* Section Headings */
  .section { padding: 3rem 0; }
  .section__header { margin-bottom: 2rem; }
  .section-title { font-size: 1.65rem; line-height: 1.25; }
  .section-subtitle { font-size: .95rem; }
  .lead { font-size: 1rem; line-height: 1.65; }

  /* Statistics Grid */
  .section--stats { padding: 2.25rem 0; }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }
  .stat-card {
    padding: 1.25rem .75rem;
    border-radius: var(--radius-md);
  }
  .stat-card__value {
    font-size: 1.75rem;
    margin-bottom: .25rem;
  }
  .stat-card__label {
    font-size: .82rem;
  }

  /* About Preview */
  .about-preview {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .about-preview__image {
    aspect-ratio: 16/10;
    max-height: 240px;
  }

  /* Doctors Grid */
  .doctors-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .doctor-card__image {
    aspect-ratio: 16/11;
  }
  .doctor-card__body {
    padding: 1.25rem 1rem;
  }
  .doctor-card__name {
    font-size: 1.25rem;
  }
  .doctor-card__footer {
    padding-top: .85rem;
  }
  .doctor-card__fee {
    font-size: 1rem;
  }

  /* Approach Steps */
  .approach-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .approach-step {
    padding: 1.25rem 1rem;
    margin-bottom: 0;
  }
  .approach-step:not(:last-child)::after {
    display: none;
  }

  /* Services Grid */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .service-card {
    padding: 1.35rem 1.15rem;
  }

  /* Products Grid (E-commerce) */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .85rem;
  }
  .product-card__body {
    padding: .95rem .85rem;
  }
  .product-card__name {
    font-size: .95rem;
    line-height: 1.3;
  }
  .product-card__desc {
    display: none; /* keep mobile product grid compact & uniform */
  }
  .product-card__price-row {
    margin-bottom: .65rem;
  }
  .product-card__price {
    font-size: 1.1rem;
  }
  .product-card__old-price {
    font-size: .8rem;
  }
  .product-card__form {
    flex-direction: column;
    gap: .4rem;
  }
  .product-card__form .btn {
    width: 100%;
    padding: .55rem .4rem;
    font-size: .82rem;
  }

  /* Product Details Page */
  .product-detail {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .product-detail__price {
    font-size: 1.85rem;
  }
  .product-detail__actions {
    flex-direction: column;
    gap: .65rem;
  }
  .product-detail__actions .btn {
    width: 100%;
    min-width: auto;
  }
  .product-detail__meta strong {
    min-width: 100px;
  }

  /* Articles Grid */
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .article-card__body {
    padding: 1.15rem 1rem;
  }
  .article-card__title {
    font-size: 1.15rem;
  }

  /* Testimonials Grid */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .testimonial-card {
    padding: 1.35rem 1.15rem;
  }

  /* Contact Preview Section */
  .contact-preview__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .contact-cards {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
  .contact-card {
    padding: .85rem 1rem;
  }
  .contact-card__value {
    font-size: .9rem;
  }
  .contact-cta {
    padding: 1.5rem 1.25rem;
  }

  /* Cart Page — Mobile Responsive Card Table */
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .cart-table thead {
    display: none; /* Hide wide table header on mobile */
  }
  .cart-table, .cart-table tbody, .cart-row {
    display: block;
    width: 100%;
  }
  .cart-row {
    display: grid;
    grid-template-columns: 68px 1fr auto;
    grid-template-rows: auto auto auto;
    gap: .45rem .75rem;
    padding: 1rem .85rem;
    border-bottom: 1px solid #edf0f5;
    background: #fff;
    position: relative;
    align-items: center;
  }
  .cart-row__image-cell {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: auto;
    padding: 0;
    border: none;
  }
  .cart-row__image {
    width: 68px;
    height: 68px;
  }
  .cart-row__name-cell {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
    border: none;
  }
  .cart-row__name {
    font-size: .95rem;
  }
  .cart-row__price-cell {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    border: none;
    font-size: .9rem;
  }
  .cart-row__qty-cell {
    grid-column: 2;
    grid-row: 3;
    padding: 0;
    border: none;
    margin-top: .15rem;
  }
  .cart-row__line-cell {
    grid-column: 3;
    grid-row: 2;
    padding: 0;
    border: none;
    text-align: right;
  }
  .cart-row__action-cell {
    grid-column: 3;
    grid-row: 1;
    padding: 0;
    border: none;
    text-align: right;
  }
  .cart-summary {
    position: static;
  }

  /* Checkout Page */
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .checkout-summary {
    position: static;
  }

  /* Appointment Wizard */
  .wizard-progress {
    margin-bottom: 2rem;
  }
  .wizard-progress__steps {
    gap: .2rem;
  }
  .wizard-progress__num {
    width: 28px;
    height: 28px;
    font-size: .78rem;
  }
  .wizard-progress__label {
    font-size: .58rem;
    letter-spacing: 0;
  }
  .wizard-form {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
  .wizard-step__header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }
  .wizard-step__title {
    font-size: 1.25rem;
  }
  .wizard-doctors {
    grid-template-columns: 1fr;
  }
  .doctor-option {
    padding: .85rem;
    gap: .75rem;
  }
  .doctor-option__image {
    width: 60px;
    height: 60px;
  }
  .doctor-option__body h3 {
    font-size: 1.05rem;
  }
  .doctor-option__hours {
    font-size: .75rem;
  }
  .wizard-consult {
    grid-template-columns: 1fr;
    gap: .75rem;
  }
  .consult-option {
    padding: 1rem;
  }
  .consult-option__icon {
    width: 44px;
    height: 44px;
  }
  .consult-option__icon svg {
    width: 24px;
    height: 24px;
  }
  .wizard-dates {
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
  }
  .date-option {
    padding: .65rem .35rem;
  }
  .date-option__day {
    font-size: .7rem;
  }
  .date-option__label {
    font-size: .82rem;
  }
  .wizard-slots__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .45rem;
  }
  .wizard-slot {
    padding: .65rem .25rem;
    font-size: .82rem;
  }
  .wizard-step__nav {
    flex-direction: column-reverse;
    gap: .75rem;
  }
  .wizard-step__nav .btn {
    width: 100%;
    min-width: auto;
  }

  /* Yoga Classes Page */
  .yoga-classes-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .yoga-class-card__body {
    padding: 1.25rem 1rem;
  }
  .yoga-class-card__footer {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
  }
  .yoga-class-card__footer .btn {
    width: 100%;
    text-align: center;
  }

  /* Footer */
  .site-footer {
    padding: 3rem 0 0;
  }
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .85rem;
  }
  .footer-legal {
    justify-content: center;
    gap: 1rem;
  }

  /* Floating UI Controls */
  .wa-float {
    width: 48px;
    height: 48px;
    bottom: 1rem;
    right: 1rem;
  }
  .wa-float svg {
    width: 24px;
    height: 24px;
  }
  .back-top {
    width: 40px;
    height: 40px;
    bottom: 1rem;
    left: 1rem;
  }

  /* Buttons on Mobile */
  .btn--lg { padding: .85rem 1.35rem; font-size: 1rem; }
  .btn--md { padding: .7rem 1.15rem; font-size: .92rem; }
}

/* ---------- VERY NARROW PHONES (under 380px) ---------- */
@media (max-width: 379px) {
  .hero__title { font-size: 1.7rem; }
  .products-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .wizard-dates { grid-template-columns: repeat(2, 1fr); }
  .wizard-slots__grid { grid-template-columns: repeat(2, 1fr); }
  .cart-row {
    grid-template-columns: 56px 1fr auto;
  }
  .cart-row__image { width: 56px; height: 56px; }
  .wizard-progress__label { display: none; } /* Hide labels on ultra-narrow phones */
}

/* ---------- LARGE DESKTOPS ---------- */
@media (min-width: 1440px) {
  :root { --container-max: 1320px; }
}
