/**
 * The Bharat Book - Master Responsive & iOS Stylesheet
 * 100% Guaranteed Zero Horizontal Overflow across all device sizes (320px to 4K),
 * Apple iOS (iPhone/iPad Safari) and Android flagships.
 */

/* ==========================================================================
   1. GLOBAL ZERO-OVERFLOW & TOUCH RESETS
   ========================================================================== */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  margin: 0;
  padding: 0;
  position: relative;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;
}

/* Touch targets and interactions */
button, a, input, select, textarea, .pill-btn, .specialty-card, .btn-view-toggle {
  touch-action: manipulation;
  -webkit-appearance: none;
}

/* ==========================================================================
   2. iOS SAFARI ENGINE SPECIFICS
   ========================================================================== */
@supports (-webkit-touch-callout: none) {
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  input, select, textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari focus */
  }

  .cart-drawer, .modal-container {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   3. DESKTOP & LARGE SCREENS (> 992px)
   ========================================================================== */
@media (min-width: 993px) {
  .btn-mobile-toggle {
    display: none !important;
  }

  .header-main {
    padding: 0.85rem 0 !important;
    gap: 1.5rem !important;
  }

  .brand-logo {
    gap: 0.75rem !important;
  }

  .logo-symbol {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.35rem !important;
  }

  .logo-name {
    font-size: 1.35rem !important;
  }

  .logo-tagline {
    font-size: 0.725rem !important;
  }

  .header-actions {
    gap: 0.65rem !important;
    flex-wrap: nowrap !important;
  }

  .header-action-btn {
    padding: 0.5rem 0.85rem !important;
    height: 38px !important;
    min-width: auto !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  .header-action-btn .action-btn-label {
    display: inline !important;
  }

  .header-nav {
    display: flex !important;
    align-items: center;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
    flex-shrink: 0;
  }

  .nav-links-list {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap !important;
  }

  .nav-link {
    white-space: nowrap !important;
    font-size: 0.88rem !important;
    padding: 0.45rem 0.75rem !important;
  }

  .hero-container {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 2.5rem;
    align-items: center;
  }

  .hero-search-form {
    flex-direction: row !important;
    align-items: center !important;
  }

  .btn-search-submit {
    width: auto !important;
    white-space: nowrap !important;
  }

  .pills-label {
    width: auto !important;
    margin-bottom: 0 !important;
  }

  .trust-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .books-grid, .catalog-books-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }

  /* Catalog / Shop Page Desktop Layout */
  .catalog-heading-row {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .catalog-controls-group {
    width: auto !important;
    justify-content: flex-end !important;
    gap: 1rem !important;
  }

  .catalog-sort-wrapper {
    width: auto !important;
    flex: initial !important;
  }

  .catalog-sort-wrapper .form-select {
    width: auto !important;
    min-width: 220px !important;
    font-size: 0.875rem !important;
  }

  .catalog-search-form {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }

  .catalog-search-btn {
    width: auto !important;
    white-space: nowrap !important;
  }

  .catalog-body-grid {
    display: grid !important;
    grid-template-columns: 270px 1fr !important;
    gap: 2rem !important;
    padding-top: 2rem !important;
    padding-bottom: 4rem !important;
  }

  .product-list-card {
    display: grid !important;
    grid-template-columns: 150px 1fr 240px !important;
    gap: 1.5rem !important;
    align-items: center !important;
  }

  .list-card-buy-box {
    border-left: 1px solid var(--border-light) !important;
    border-top: none !important;
    padding-left: 1.5rem !important;
    padding-top: 0 !important;
  }

  /* Product Detail Desktop Layout */
  .product-detail-layout {
    display: grid !important;
    grid-template-columns: 380px 1fr !important;
    gap: 3.5rem !important;
    margin-bottom: 3.5rem !important;
  }

  .detail-gallery-col {
    max-width: 380px !important;
  }

  .detail-purchase-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.85rem !important;
  }

  .btn-add-cart-detail, .btn-rent-detail {
    width: auto !important;
  }

  .btn-wishlist-lg {
    width: 50px !important;
    height: 50px !important;
    flex-shrink: 0 !important;
  }

  .detail-quick-specs {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .rental-policy-explainer {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .promo-strip-inner {
    display: grid;
    grid-template-columns: 1fr 240px;
    align-items: center;
    gap: 2.5rem;
  }

  .bulk-order-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    padding: 2.25rem;
  }

  .about-stats-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem !important;
  }

  .about-grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.75rem !important;
  }

  .contact-grid {
    display: grid !important;
    grid-template-columns: 1fr 1.2fr !important;
    gap: 2.5rem !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
  }

  .footer-grid {
    display: grid !important;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr !important;
    gap: 2.5rem !important;
    margin-bottom: 3.5rem !important;
  }

  .footer-bottom-inner {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
  }
}

@media (min-width: 1201px) {
  .specialties-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .books-grid, .catalog-books-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* ==========================================================================
   4. TABLETS & SMALL DESKTOPS (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .section-padding {
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
  }

  /* Header & Navigation */
  .site-header {
    padding-top: max(0.4rem, env(safe-area-inset-top));
    width: 100%;
    max-width: 100vw;
  }

  .header-main {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    padding: 0.6rem 0 !important;
    width: 100% !important;
  }

  .header-btn-desktop-only {
    display: none !important;
  }

  .mobile-only-link {
    display: block !important;
  }

  .brand-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
    min-width: max-content !important;
    overflow: visible !important;
  }

  .logo-symbol {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
  }

  .logo-text-group {
    display: flex !important;
    flex-direction: column !important;
    min-width: max-content !important;
    overflow: visible !important;
  }

  .logo-name {
    font-size: 1.18rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    line-height: 1.1 !important;
  }

  .logo-tagline {
    font-size: 0.64rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
    display: block !important;
  }

  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  .header-action-btn, .btn-mobile-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    cursor: pointer;
    background: var(--bg-main) !important;
    border: 1.5px solid var(--border-medium) !important;
    border-radius: var(--radius-sm) !important;
    flex-shrink: 0 !important;
  }

  .header-action-btn .action-btn-label {
    display: none !important;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-width: 100vw;
    background-color: var(--bg-main);
    border-bottom: 2px solid var(--medical-teal);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
    z-index: 999;
    max-height: calc(100dvh - 65px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .header-nav.mobile-open {
    display: block !important;
    animation: slideDownNav 0.2s ease-out forwards;
  }

  @keyframes slideDownNav {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-links-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 0.85rem 1.2rem;
    font-size: 0.975rem;
    border-radius: var(--radius-sm);
    background-color: var(--bg-subtle);
  }

  /* Hero Section */
  .hero-section {
    padding: 2.5rem 0;
    width: 100%;
  }

  .hero-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
  }

  .hero-title {
    font-size: clamp(1.65rem, 5vw, 2.25rem);
  }

  /* Trust Banner */
  .trust-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
  }

  /* Specialties Grid */
  .specialties-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
  }

  /* Books Grid */
  .books-grid, .catalog-books-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    width: 100%;
  }

  /* Catalog Layout */
  .catalog-body-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
  }

  .catalog-sidebar {
    margin-bottom: 1rem;
    width: 100%;
  }

  /* Product Details Layout */
  .product-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
  }

  .detail-gallery-col {
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }

  /* Promo Banner */
  .promo-strip-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
  }

  /* Bulk Order Card */
  .bulk-order-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.75rem;
    width: 100%;
  }

  /* Footer */
  .site-footer {
    padding-top: 3rem;
  }

  .footer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 2rem !important;
    margin-bottom: 2.5rem !important;
    width: 100%;
  }

  .footer-bottom-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    text-align: center !important;
  }

  /* Rental Wallet & Cart */
  .wallet-metrics-grid {
    grid-template-columns: 1fr;
  }

  .rental-card-main {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .rental-policy-explainer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cart-page-grid {
    grid-template-columns: 1fr;
  }

  .cart-table-header {
    display: none;
  }

  .cart-row-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .about-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
  }

  .about-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
  }

  .contact-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   5. MOBILE SCREENS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-subtitle {
    font-size: 0.875rem;
  }

  /* Header Actions - Icon Only Mode */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .header-action-btn {
    padding: 0.45rem 0.55rem;
    min-width: 38px;
    height: 38px;
    justify-content: center;
    position: relative;
  }

  .header-action-btn .action-btn-label {
    display: none !important;
  }

  .action-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
  }

  /* Hero Elements */
  .hero-content, .hero-highlights-card {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .hero-badge {
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 100% !important;
    font-size: 0.725rem !important;
    line-height: 1.35 !important;
    box-sizing: border-box !important;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.5vw, 2rem) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    line-height: 1.25 !important;
  }

  .hero-search-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero-search-form .search-input-group {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .hero-search-form input {
    font-size: 16px !important;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .btn-search-submit {
    width: 100%;
    min-height: 44px;
    font-size: 0.925rem;
    box-sizing: border-box;
  }

  /* Wrapped touch pills without horizontal expansion */
  .hero-dept-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .pills-label {
    width: 100%;
    display: block;
    font-size: 0.775rem;
    color: #94a3b8;
    margin-bottom: 0.15rem;
  }

  .pill-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    box-sizing: border-box;
  }

  /* Promo Strip Banner */
  .promo-strip-inner {
    text-align: center;
  }

  .promo-actions {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .promo-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .promo-badge-box {
    width: 100%;
    padding: 1.25rem;
  }

  /* Catalog Page Mobile Controls */
  .catalog-heading-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .catalog-search-container {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .catalog-search-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .catalog-search-input {
    font-size: 16px !important;
    width: 100%;
  }

  .catalog-search-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .catalog-sort-wrapper {
    width: 100%;
    justify-content: space-between;
  }

  .catalog-sort-wrapper .form-select {
    width: 100%;
    min-width: 0;
    font-size: 16px !important;
  }

  .catalog-pagination-wrap {
    padding: 1rem 0.75rem;
    width: 100%;
  }

  .pagination-nav {
    width: 100%;
    justify-content: center;
    gap: 0.25rem;
  }

  .pagination-btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
    min-width: 36px;
    height: 36px;
  }

  /* Forms on Mobile */
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-control, .form-select, textarea {
    font-size: 16px !important;
    width: 100%;
  }

  /* Product List View */
  .product-list-card {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
  }

  .list-card-buy-box {
    border-left: none;
    border-top: 1px solid var(--border-light);
    padding-left: 0;
    padding-top: 1rem;
  }

  /* Product Detail Page on Tablets & Mobile */
  .product-detail-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    margin-bottom: 2rem !important;
    width: 100% !important;
  }

  .detail-gallery-col {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .detail-cover-showcase {
    width: 100% !important;
    padding: 1.5rem 1rem !important;
    box-sizing: border-box !important;
  }

  .book-cover-container.size-large, .book-3d-wrapper.size-large, .book-online-cover-box.size-large {
    width: 220px !important;
    height: 300px !important;
    max-width: 90% !important;
  }

  .size-large .cover-book-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
  }

  .size-large .cover-book-author {
    font-size: 0.75rem !important;
  }

  .size-large .cover-center-emblem {
    font-size: 2.5rem !important;
    margin: 0.4rem 0 !important;
  }

  .detail-purchase-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
  }

  .quantity-selector-box {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .btn-add-cart-detail, .btn-rent-detail {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 0.925rem !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .btn-wishlist-lg {
    width: 100% !important;
    height: 42px !important;
    border-radius: var(--radius-sm) !important;
  }

  .detail-quick-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    padding: 0.75rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .qspec-item {
    border-right: none !important;
    padding: 0 !important;
  }

  .qspec-item:nth-child(odd) {
    border-right: 1px solid var(--border-light) !important;
    padding-right: 0.65rem !important;
  }

  .detail-tabs-section {
    margin-bottom: 2rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .tabs-header {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .tab-btn {
    white-space: nowrap !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.825rem !important;
    flex-shrink: 0 !important;
  }

  .tabs-body {
    padding: 1.25rem 0.85rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .rental-policy-explainer {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .specs-table-wrapper {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  /* About Us Page Mobile Responsive */
  .about-page-wrapper {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .about-hero {
    margin-bottom: 1.75rem !important;
    text-align: center !important;
  }

  .about-lead {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    padding: 0 0.25rem !important;
    margin-top: 0.75rem !important;
  }

  .about-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.75rem !important;
  }

  .about-stat-card {
    padding: 1.15rem 0.65rem !important;
  }

  .about-stat-card .stat-number {
    font-size: 1.45rem !important;
  }

  .about-stat-card .stat-label {
    font-size: 0.725rem !important;
  }

  .about-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin-bottom: 1.75rem !important;
  }

  .about-box {
    padding: 1.35rem 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .about-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.3rem !important;
    margin-bottom: 0.85rem !important;
  }

  .about-box h3 {
    font-size: 1.05rem !important;
  }

  .about-box p {
    font-size: 0.825rem !important;
  }

  .about-vision-card {
    padding: 1.5rem 1rem !important;
    margin-bottom: 1.75rem !important;
  }

  .about-vision-content h2 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
    margin: 0.65rem 0 0.85rem !important;
  }

  .about-vision-content p {
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.35rem !important;
  }

  .about-actions-row {
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }

  .about-actions-row .btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
  }

  /* College & Library Orders Contact Page */
  .contact-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    width: 100% !important;
  }

  .contact-info-card, .contact-form-card {
    padding: 1.25rem 1rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .cinfo-item {
    font-size: 0.8125rem !important;
    word-break: break-word !important;
    gap: 0.65rem !important;
  }

  /* Footer Mobile Styles */
  .site-footer {
    padding-top: 2.5rem !important;
  }

  .footer-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    margin-bottom: 2rem !important;
    width: 100% !important;
  }

  .footer-col {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .footer-col h4 {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.35rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .footer-about-text {
    font-size: 0.825rem !important;
    line-height: 1.55 !important;
    margin-bottom: 0.75rem !important;
  }

  .footer-links {
    gap: 0.45rem !important;
  }

  .footer-links a {
    font-size: 0.825rem !important;
    padding: 0.2rem 0 !important;
    display: inline-block !important;
  }

  .footer-contact-list {
    gap: 0.65rem !important;
  }

  .footer-contact-list li {
    font-size: 0.8125rem !important;
    word-break: break-word !important;
    align-items: flex-start !important;
  }

  .footer-bottom {
    padding: 1.25rem 0 !important;
  }

  .footer-bottom-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    text-align: center !important;
    font-size: 0.75rem !important;
  }

  .footer-security-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    font-size: 0.725rem !important;
  }
}

/* ==========================================================================
   6. SMARTPHONES - (<= 580px: iPhone 12/13/14/15/16 Pro Max, Plus, Galaxy)
   ========================================================================== */
@media (max-width: 580px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
  }

  .brand-logo {
    gap: 0.45rem;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
  }

  .logo-symbol {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .logo-name {
    font-size: 1.15rem;
    white-space: nowrap;
  }

  .logo-tagline {
    font-size: 0.65rem;
    white-space: nowrap;
  }

  /* Hero Section */
  .hero-section {
    padding: 1.75rem 0;
    width: 100%;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.55rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    width: 100%;
    white-space: normal !important;
    word-break: break-word !important;
    box-sizing: border-box;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.8vw, 1.85rem);
    line-height: 1.25;
    margin-bottom: 0.65rem;
    word-break: break-word;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.15rem;
  }

  .hero-highlights-card {
    padding: 1.15rem;
    width: 100%;
  }

  .hero-card-header {
    gap: 0.65rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
  }

  .hero-card-header i {
    font-size: 1.5rem;
  }

  .hero-card-header h3 {
    font-size: 1rem;
  }

  /* Trust Grid */
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .trust-item {
    background-color: var(--bg-main);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    width: 100%;
  }

  /* Medical Specialties Grid */
  .specialties-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    width: 100%;
  }

  .specialty-card {
    padding: 0.75rem 0.85rem;
    width: 100%;
  }

  /* Product Cards Grid: 2 columns in a row on mobile */
  .books-grid, .catalog-books-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .product-card {
    padding: 0.65rem 0.5rem !important;
    border-radius: var(--radius-sm) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-card-top {
    min-height: 20px !important;
    margin-bottom: 0.35rem !important;
  }

  .product-tag, .product-dept-tag {
    font-size: 0.575rem !important;
    padding: 0.1rem 0.3rem !important;
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .btn-wishlist {
    font-size: 0.9rem !important;
    padding: 0.1rem !important;
  }

  .product-card-media-box {
    padding: 0.5rem 0.25rem !important;
    margin-bottom: 0.45rem !important;
    border-radius: var(--radius-sm) !important;
    min-height: 140px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .size-medium, .book-3d-wrapper.size-medium, .book-online-cover-box.size-medium, .book-cover-container.size-medium {
    height: 135px !important;
    width: 95px !important;
    max-width: 95px !important;
  }

  .book-online-img {
    max-height: 135px !important;
    width: auto !important;
    object-fit: contain !important;
  }

  .cover-book-title {
    font-size: 0.625rem !important;
    line-height: 1.15 !important;
  }

  .cover-book-author {
    font-size: 0.525rem !important;
  }

  .cover-center-emblem i {
    font-size: 1.15rem !important;
  }

  .product-level-row {
    font-size: 0.625rem !important;
    margin-bottom: 0.2rem !important;
  }

  .product-year-badge {
    font-size: 0.6rem !important;
  }

  .product-pub-badge {
    font-size: 0.575rem !important;
  }

  .product-title {
    font-size: 0.8rem !important;
    line-height: 1.25 !important;
    height: 2.1rem !important;
    -webkit-line-clamp: 2 !important;
    margin-bottom: 0.2rem !important;
  }

  .product-author {
    font-size: 0.675rem !important;
    margin-bottom: 0.25rem !important;
  }

  .product-rating-row {
    font-size: 0.65rem !important;
    margin-bottom: 0.3rem !important;
  }

  .stars-row i {
    font-size: 0.575rem !important;
  }

  .stock-pill-sm {
    display: none !important;
  }

  .product-pricing-box {
    padding-top: 0.35rem !important;
    margin-bottom: 0.45rem !important;
  }

  .pricing-main-line {
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem;
  }

  .price-current {
    font-size: 0.95rem !important;
  }

  .price-mrp {
    font-size: 0.725rem !important;
  }

  .discount-badge {
    font-size: 0.575rem !important;
    padding: 0.05rem 0.25rem !important;
  }

  .rental-micro-badge {
    font-size: 0.625rem !important;
    padding: 0.15rem 0.35rem !important;
    margin-top: 0.2rem !important;
    line-height: 1.2 !important;
  }

  .product-card-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
    width: 100% !important;
  }

  .product-card-actions .btn-quick-view {
    display: none !important;
  }

  .product-card-actions .btn-add-cart {
    width: 100% !important;
    min-height: 34px !important;
    font-size: 0.775rem !important;
    padding: 0.4rem 0.5rem !important;
    justify-content: center !important;
  }

  .btn-rent-inline {
    width: 100% !important;
    min-height: 32px !important;
    font-size: 0.725rem !important;
    font-weight: 700 !important;
    padding: 0.35rem 0.45rem !important;
    margin-top: 0.3rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  /* Bulk Order Card */
  .bulk-order-card {
    padding: 1.15rem;
    gap: 1.25rem;
    width: 100%;
  }

  .bulk-order-content h2 {
    font-size: 1.25rem;
  }

  .bulk-order-form-box {
    padding: 1rem;
    width: 100%;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
  }

  .site-footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }

  /* Slide-out Cart Drawer */
  .cart-drawer {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    height: 100vh;
  }

  .cart-drawer-footer {
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }

  /* Modal Container */
  .modal-container {
    width: 95vw;
    max-height: 90dvh;
    max-height: 90vh;
    padding: 1.15rem;
  }
}

/* ==========================================================================
   7. COMPACT / SMALL PHONES (<= 380px: iPhone SE, 5, Mini)
   ========================================================================== */
@media (max-width: 380px) {
  .container {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .brand-logo {
    gap: 0.35rem !important;
  }

  .logo-text-group .logo-tagline {
    font-size: 0.58rem !important;
    display: block !important;
  }

  .logo-name {
    font-size: 1.05rem !important;
  }

  .logo-symbol {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.95rem !important;
  }

  .header-actions {
    gap: 0.25rem !important;
  }

  .header-action-btn, .btn-mobile-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .books-grid, .catalog-books-grid {
    gap: 0.45rem !important;
  }

  .product-card {
    padding: 0.5rem 0.35rem !important;
  }

  .size-medium, .book-3d-wrapper.size-medium, .book-online-cover-box.size-medium, .book-cover-container.size-medium {
    height: 120px !important;
    width: 82px !important;
    max-width: 82px !important;
  }

  .size-large, .book-3d-wrapper.size-large, .book-online-cover-box.size-large, .book-cover-container.size-large {
    height: 240px !important;
    width: 175px !important;
    max-width: 175px !important;
  }

  .about-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .product-title {
    font-size: 0.75rem !important;
    height: 1.95rem !important;
  }

  .phb-right-metrics {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
  }

  .phb-metric-item {
    padding: 0.5rem !important;
  }

  .metric-val {
    font-size: 1.1rem !important;
  }
}

/* Profile Dropdown & Modal Mobile Adjustments */
@media (max-width: 768px) {
  .profile-dropdown-menu {
    width: 290px !important;
    min-width: 280px !important;
    right: 0 !important;
    left: auto !important;
  }

  .profile-header-banner .phb-card {
    padding: 1.25rem;
  }

  .phb-left {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .phb-title-row {
    justify-content: center;
  }

  .phb-meta-tags {
    justify-content: center;
  }

  .phb-right-metrics {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-two-col, .rentals-cards-grid, .addresses-grid {
    grid-template-columns: 1fr;
  }

  .shortcuts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tm-meta-banner {
    grid-template-columns: 1fr;
  }

  .ocd-header, .ocd-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .ocd-footer-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* Rental Wallet Dashboard Mobile */
  .wallet-hero-banner {
    padding: 1.5rem 0 2rem;
  }

  .wallet-title {
    font-size: 1.35rem;
  }

  .wallet-sub {
    font-size: 0.85rem;
  }

  .wallet-metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    margin-top: 1rem !important;
  }

  .wallet-metric-card {
    padding: 1.15rem;
  }

  .wmc-amount {
    font-size: 1.75rem !important;
  }

  .rental-card-main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .timeline-stepper {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem 0.35rem;
  }
}

/* ==========================================================================
   CART & CHECKOUT MASTER RESPONSIVE SUITE
   Zero horizontal overflow, 100% fluid scaling from 320px to 4K displays,
   iOS Safari zoom fixes, Android touch optimizations, macOS & Windows crisp layout.
   ========================================================================== */

/* Cart & Checkout Page Wrappers */
.tbb-cart-wrapper,
.tbb-checkout-wrapper {
  padding-top: 32px;
  padding-bottom: 60px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .tbb-cart-wrapper,
  .tbb-checkout-wrapper {
    padding-top: 18px;
    padding-bottom: 110px !important; /* Generous clearance for mobile sticky action bar */
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 480px) {
  .tbb-cart-wrapper,
  .tbb-checkout-wrapper {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Page Header Sections */
.cart-header-section,
.checkout-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.cart-header-title,
.checkout-header-title {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 800;
  color: #0a1f38;
  margin: 0 0 4px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.cart-header-sub,
.checkout-header-sub {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.cart-count-badge {
  background: #0a1f38;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(10,31,56,0.15);
}

/* Main Layout Grids */
.cart-main-grid,
.checkout-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 390px);
  gap: 28px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1024px) {
  .cart-main-grid,
  .checkout-main-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Left Content Columns */
.cart-items-column,
.checkout-form-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

/* Cart Item Card */
.cart-item-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  box-sizing: border-box;
}

.cart-item-card:hover {
  border-color: #cbd5e1;
}

@media (max-width: 576px) {
  .cart-item-card {
    padding: 14px 12px;
  }
}

.cart-item-top {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

@media (max-width: 480px) {
  .cart-item-top {
    gap: 12px;
  }
}

.cart-item-thumb {
  width: 76px;
  height: 104px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #f8fafc;
}

@media (max-width: 480px) {
  .cart-item-thumb {
    width: 64px;
    height: 88px;
  }
}

.cart-item-content {
  flex: 1;
  min-width: 0;
}

.cart-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cart-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #0a1f38;
  margin: 0 0 4px;
  line-height: 1.4;
  word-break: break-word;
}

.cart-item-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.cart-item-title a:hover {
  color: #0d9488;
}

.cart-item-meta {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cart-remove-btn {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #ef4444;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  touch-action: manipulation;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

.cart-remove-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.cart-remove-btn:active {
  transform: scale(0.94);
}

/* Rental Plan Box */
.cart-rental-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
  box-sizing: border-box;
}

.cart-rental-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cart-rental-select-group {
  flex: 1;
  min-width: 210px;
  max-width: 100%;
}

.cart-rental-select-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #0f766e;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.cart-rental-select {
  width: 100%;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 12px;
  min-height: 42px;
  color: #0a1f38;
  border: 1.5px solid #0d9488;
  background-color: #ffffff;
  border-radius: 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230d9488' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .cart-rental-select {
    font-size: 16px !important; /* iOS Safari auto zoom fix */
  }
}

.cart-rental-metrics {
  text-align: right;
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .cart-rental-row {
    flex-direction: column;
    align-items: stretch;
  }
  .cart-rental-metrics {
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
  }
}

/* Price & Quantity Stepper Footer */
.cart-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.cart-qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 3px;
}

.cart-qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #0a1f38;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  touch-action: manipulation;
  transition: all 0.15s;
}

.cart-qty-btn:active {
  background: #e2e8f0;
  transform: scale(0.95);
}

.cart-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-qty-val {
  font-weight: 800;
  font-size: 15px;
  min-width: 28px;
  text-align: center;
  color: #0a1f38;
}

.cart-item-price-col {
  text-align: right;
}

.cart-item-price-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  display: block;
  letter-spacing: 0.2px;
}

.cart-item-price-val {
  font-size: 18px;
  font-weight: 900;
  color: #0a1f38;
  line-height: 1.2;
}

/* Return Policy & Guarantee Badges */
.cart-return-policy {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 18px;
  box-sizing: border-box;
}

@media (max-width: 576px) {
  .cart-return-policy {
    padding: 14px;
  }
}

.cart-policy-flex {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

@media (max-width: 480px) {
  .cart-policy-flex {
    flex-direction: column;
    gap: 8px;
  }
}

/* Guarantee Badges Grid */
.cart-guarantee-badges {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  font-size: 12px;
  color: #475569;
}

/* Summary Cards (Cart & Checkout) */
.cart-summary-card,
.checkout-summary-card {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  background: #ffffff;
  position: sticky;
  top: 24px;
  box-sizing: border-box;
}

@media (max-width: 1024px) {
  .cart-summary-card,
  .checkout-summary-card {
    position: static;
  }
}

@media (max-width: 576px) {
  .cart-summary-card,
  .checkout-summary-card {
    padding: 18px 14px;
  }
}

/* Checkout Form Layout */
.checkout-card {
  padding: 26px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  background: #ffffff;
  box-sizing: border-box;
}

@media (max-width: 576px) {
  .checkout-card {
    padding: 18px 14px;
  }
}

.checkout-step-heading {
  font-size: 17px;
  font-weight: 800;
  color: #0a1f38;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkout-step-num {
  width: 28px;
  height: 28px;
  background: #0a1f38;
  color: #ffffff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Responsive Form Rows */
.checkout-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.checkout-form-row-uneven {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .checkout-form-row-2,
  .checkout-form-row-uneven {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }
}

/* Touch-Optimized Cross-OS Inputs */
.checkout-input,
.checkout-select,
.checkout-textarea {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  color: #0a1f38;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

@media (max-width: 768px) {
  .checkout-input,
  .checkout-select,
  .checkout-textarea {
    font-size: 16px !important; /* Critical: Stops iOS Safari auto-zoom on focus */
  }
}

.checkout-input:focus,
.checkout-select:focus,
.checkout-textarea:focus {
  border-color: #0d9488;
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.checkout-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.41 0L6 4.58L10.59 0L12 1.41l-6 6l-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.checkout-textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

/* Payment Method Cards */
.payment-card-label {
  display: block;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  box-sizing: border-box;
}

.payment-card-label.selected,
.payment-card-label:has(input[type="radio"]:checked) {
  border: 2px solid #0d9488;
  background: #f0fdfa;
}

.payment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payment-card-radio-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.payment-radio-input {
  width: 20px;
  height: 20px;
  accent-color: #0d9488;
  cursor: pointer;
  flex-shrink: 0;
}

/* Dynamic UPI Box */
.upi-interactive-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #99f6e4;
}

.upi-box-grid {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 640px) {
  .upi-box-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.upi-qr-wrapper {
  background: #ffffff;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccfbf1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
  width: fit-content;
  margin: 0 auto;
}

.upi-qr-img {
  width: 150px;
  height: 150px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* 1-Click Mobile App Buttons Grid */
.upi-apps-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.upi-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  color: #0a1f38;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.upi-app-btn:active {
  background: #f1f5f9;
  transform: scale(0.97);
}

/* Order Itemized List in Summary */
.checkout-items-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
}

.checkout-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}

.checkout-preview-title {
  color: #0a1f38;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
  flex: 1;
}

/* Mobile Sticky Action Bars */
.cart-mobile-sticky-bar,
.checkout-mobile-sticky-bar {
  display: none;
}

@media (max-width: 768px) {
  .cart-mobile-sticky-bar,
  .checkout-mobile-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    gap: 14px;
    box-sizing: border-box;
  }

  .mobile-bar-total-block {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }

  .mobile-bar-total-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
  }

  .mobile-bar-total-val {
    font-size: 20px;
    font-weight: 900;
    color: #0a1f38;
    line-height: 1.1;
  }

  .mobile-bar-action-btn {
    flex: 1;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    background: #0a1f38;
    color: #ffffff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(10,31,56,0.25);
    touch-action: manipulation;
    transition: transform 0.1s;
  }

  .mobile-bar-action-btn:active {
    transform: scale(0.97);
  }
}