/*
 * MediShop — Full Responsive Stylesheet
 * Covers: 320px · 375px · 480px · 600px · 768px · 1024px · 1200px · 1440px
 * Appended after style.css via wp_enqueue_style in functions.php
 */

/* ============================================================
   RESPONSIVE TOKENS
   ============================================================ */
:root {
  --container-pad:   20px;
  --section-pad:     60px;
}
@media (max-width: 768px) {
  :root {
    --container-pad: 16px;
    --section-pad:   44px;
  }
}
@media (max-width: 480px) {
  :root {
    --container-pad: 14px;
    --section-pad:   36px;
  }
}

/* ============================================================
   GLOBAL — CONTAINER & SECTION PADDING
   ============================================================ */
.container {
  padding-left:  var(--container-pad);
  padding-right: var(--container-pad);
}
.section-padding {
  padding-top:    var(--section-pad);
  padding-bottom: var(--section-pad);
}

/* ============================================================
   TOP BAR
   ============================================================ */

/* ≤ 900px — hide contact info on smaller desktops */
@media (max-width: 900px) {
  .topbar-left { gap: 12px; }
  .topbar-trust { gap: 10px; font-size: 0.75rem; }
}

/* ≤ 768px — stack top bar */
@media (max-width: 768px) {
  .topbar-inner {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
  }
  .topbar-left  { display: none; }           /* hide phone/email */
  .topbar-right { justify-content: center; gap: 14px; }
  .topbar-trust span { font-size: 0.77rem; }
}

/* ≤ 480px — keep only shipping badge */
@media (max-width: 480px) {
  .topbar-trust { display: none; }
  .topbar-center { width: 100%; text-align: center; }
  #medishop-topbar { padding: 7px 0; }
}

/* ============================================================
   HEADER
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .header-search { max-width: 400px; }
  /* Hide the text label spans inside header icon buttons on mobile —
     but explicitly KEEP the count badge visible (it's also a span). */
  .header-icon-btn span:not(.icon-badge) { display: none; }
  .header-icon-btn { padding: 8px; }
  .header-inner { gap: 16px; }
}

/* ≤ 768px — compact header, search moves to second row */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
  }
  .header-logo   { order: 1; flex: 1; }
  .mobile-menu-toggle { order: 2; }
  .header-icons  { order: 3; margin-left: 0; gap: 2px; }
  .header-search { order: 4; flex-basis: 100%; max-width: 100%; }

  .header-icon-btn { padding: 6px 8px; }
  .header-icon-btn i { font-size: 1.25rem; }
  .icon-badge { top: 2px; right: 4px; width: 16px; height: 16px; font-size: 0.6rem; }
  .logo-text { font-size: 1.35rem; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .header-icons { gap: 0; }
  .logo-text { font-size: 1.2rem; }
  /* hide compare on very small screens */
  .header-icons a[aria-label*="Compare"] { display: none; }
  /* collapse search category dropdown */
  .search-category { min-width: 90px; font-size: 0.78rem; padding: 0 8px; }
  .search-input { font-size: 0.82rem; padding: 10px 10px; }
}

/* ≤ 375px */
@media (max-width: 375px) {
  .search-category { display: none; }
  .search-form { border-radius: var(--radius); }
}

/* ============================================================
   NAVIGATION BAR
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .primary-nav > li > a { padding: 12px 10px; font-size: 0.84rem; }
  .nav-promo { display: none; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  #medishop-nav { display: none; }   /* replaced by mobile panel */
  .mobile-menu-toggle { display: flex; }
}

/* ============================================================
   MOBILE MENU PANEL
   ============================================================ */
@media (max-width: 768px) {
  #mobile-menu-panel { width: min(300px, 88vw); }
  .mobile-nav a { font-size: 0.9rem; padding: 13px 20px; }
}

/* ============================================================
   HERO SECTION
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .hero-section { padding: 60px 0; }
  .hero-inner { gap: 40px; }
  .hero-float-card.card-2 { right: -2%; }
}

/* ≤ 768px — single column, no image */
@media (max-width: 768px) {
  .hero-section { padding: 50px 0 44px; }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0;
  }
  .hero-image { display: none; }
  .hero-actions { justify-content: center; }
  .hero-trust   { justify-content: center; flex-wrap: wrap; gap: 16px; }
  .hero-trust-item { align-items: center; }
  .hero-badge { display: inline-flex; }
  .hero-desc { font-size: 0.95rem; }
}

/* ≤ 600px */
@media (max-width: 600px) {
  .hero-section { padding: 36px 0; }
  .hero-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .hero-actions { flex-direction: column; align-items: center; gap: 10px; }
  .hero-actions .btn { width: 100%; max-width: 280px; }
  .hero-trust { gap: 10px; }
  .hero-trust-item strong { font-size: 1rem; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .hero-trust { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   TRUST BAR
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .trust-items { gap: 12px; }
  .trust-item-text strong { font-size: 0.82rem; }
  .trust-item-text span   { display: none; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .trust-bar { padding: 14px 0; }
  .trust-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .trust-item { flex-direction: column; text-align: center; gap: 6px; }
  .trust-item-text span { display: block; font-size: 0.72rem; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .trust-items { grid-template-columns: 1fr 1fr; }
}

/* ≤ 375px */
@media (max-width: 375px) {
  .trust-items { grid-template-columns: 1fr; }
  .trust-item  { flex-direction: row; text-align: left; }
}

/* ============================================================
   CATEGORIES SECTION
   ============================================================ */

/* ≤ 1200px */
@media (max-width: 1200px) {
  .categories-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ≤ 1024px */
@media (max-width: 1024px) {
  .categories-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .category-card { padding: 18px 12px; }
  .category-icon { width: 52px; height: 52px; font-size: 1.3rem; margin-bottom: 10px; }
  .category-card h4 { font-size: 0.82rem; }
  .category-card span { display: none; }  /* hide item count on mobile */
}

/* ≤ 480px */
@media (max-width: 480px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .category-card { padding: 14px 8px; }
  .category-icon { width: 44px; height: 44px; font-size: 1.1rem; margin-bottom: 8px; }
  .category-card h4 { font-size: 0.78rem; }
}

/* ≤ 375px */
@media (max-width: 375px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   PRODUCTS SECTION (Home)
   ============================================================ */

/* ≤ 1200px */
@media (max-width: 1200px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ≤ 1024px */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .products-tabs { flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .products-tab  { padding: 8px 16px; font-size: 0.82rem; flex: 1; text-align: center; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-card-image { padding: 14px; }
  .product-card-image img { max-height: 130px; }
  .product-card-body { padding: 12px; }
  .product-title { font-size: 0.82rem; }
  .price-current { font-size: 0.95rem; }
}

/* ≤ 375px */
@media (max-width: 375px) {
  .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ============================================================
   PRODUCT CARD — hover actions always visible on touch
   ============================================================ */
@media (hover: none) {
  .product-actions {
    opacity: 1;
    transform: translateX(0);
    flex-direction: row;
    gap: 4px;
    top: auto;
    bottom: 56px;   /* above the add-to-cart button */
    right: 10px;
  }
}

/* ============================================================
   PROMO BANNERS
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .promo-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .promo-banner-1 { grid-column: 1 / -1; }
}

/* ≤ 600px */
@media (max-width: 600px) {
  .promo-grid { grid-template-columns: 1fr; }
  .promo-banner-1 { grid-column: auto; }
  .promo-banner { padding: 24px 20px; min-height: 130px; }
  .promo-banner h3 { font-size: 1.05rem; }
}

/* ============================================================
   SHOP PAGE — LAYOUT
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .shop-layout { grid-template-columns: 220px 1fr; gap: 20px; }
}

/* ≤ 768px — sidebar becomes an off-canvas drawer trigger */
@media (max-width: 768px) {
  .shop-layout {
    grid-template-columns: 1fr;
    padding: 24px 0;
  }
  .shop-sidebar { order: 2; }
  .shop-main    { order: 1; }

  /* Collapsible sidebar on mobile */
  .shop-sidebar {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
  }
  .shop-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: var(--white);
    border: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
    cursor: pointer;
  }
  .shop-sidebar-toggle i { margin-left: auto; transition: transform 0.25s ease; }
  .shop-sidebar-toggle.open i { transform: rotate(180deg); }
  .shop-sidebar-inner {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .shop-sidebar-inner.open { max-height: 2000px; }
}

/* ≤ 768px — shop toolbar wraps nicely */
@media (max-width: 768px) {
  .shop-toolbar { gap: 10px; }
  .shop-results-count { width: 100%; }
  .shop-sort { width: 100%; justify-content: space-between; }
  .sort-select { flex: 1; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .shop-products-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .shop-products-grid.list-view { grid-template-columns: 1fr !important; }
}

/* ≤ 375px */
@media (max-width: 375px) {
  .shop-products-grid { grid-template-columns: 1fr !important; }
}

/* List view: responsive stacking */
@media (max-width: 768px) {
  .shop-products-grid.list-view .product-card {
    grid-template-columns: 110px 1fr;
  }
  .shop-products-grid.list-view .product-card-footer {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .shop-products-grid.list-view .product-card {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   SINGLE PRODUCT
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .single-product-layout { gap: 30px; padding: 36px 0; }
  .gallery-main { min-height: 300px; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .single-product-layout {
    grid-template-columns: 1fr;
    padding: 24px 0;
    gap: 24px;
  }
  .gallery-main { min-height: 260px; }
  .gallery-main img { max-height: 260px; }
  .gallery-thumb { width: 64px; height: 64px; }
  .product-price-block { padding: 12px; }
  .product-price-block .price-current { font-size: 1.5rem; }
  .product-trust { grid-template-columns: repeat(3, 1fr); }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .gallery-main { min-height: 220px; }
  .gallery-main img { max-height: 220px; }
  .gallery-thumb { width: 54px; height: 54px; }
  .product-add-cart { flex-wrap: wrap; gap: 10px; }
  .product-add-cart .btn-add-cart,
  .product-add-cart .btn-buy-now { width: 100%; justify-content: center; }
  .product-actions-row { gap: 8px; }
  .product-actions-row .btn { font-size: 0.82rem; padding: 9px 14px; }
  .product-trust { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tabs-nav { overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
  .tabs-nav .tab-btn { padding: 12px 18px; font-size: 0.82rem; }
}

/* ============================================================
   VARIATION PRICE TABLE
   Responsive rules now live in price-table-responsive.css
   (loaded after this file) which uses a card layout on mobile
   instead of shrinking the table. See that file for details.
   ============================================================ */

/* ============================================================
   CART PAGE
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .cart-layout { grid-template-columns: 1fr 320px; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .cart-layout { grid-template-columns: 1fr; gap: 20px; padding: 24px 0; }
  .cart-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cart-table { min-width: 500px; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .cart-table { min-width: 420px; }
  .cart-table th, .cart-table td { padding: 12px 12px; font-size: 0.82rem; }
  .cart-product-img { width: 54px; height: 54px; }
  .cart-product-name { font-size: 0.82rem; }
  /* Hide quantity column label, keep control */
  .cart-table th:nth-child(3) { display: none; }
  .cart-table td:nth-child(3) { display: none; }
}

/* ============================================================
   CHECKOUT PAGE
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .checkout-layout { grid-template-columns: 1fr 360px; gap: 24px; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .checkout-layout { grid-template-columns: 1fr; padding: 24px 0; }
  .checkout-order-summary {
    order: -1;
    position: static;
  }
  .checkout-form { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .checkout-form { padding: 16px; }
  .payment-option { padding: 12px; }
  .payment-icons img { height: 20px; }
}

/* ============================================================
   MY ACCOUNT
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .account-layout { grid-template-columns: 210px 1fr; gap: 20px; }
  .account-stats  { grid-template-columns: repeat(2, 1fr); }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .account-layout { grid-template-columns: 1fr; padding: 24px 0; gap: 16px; }
  .account-stats  { grid-template-columns: repeat(2, 1fr); }

  /* Horizontal scrolling account nav on mobile */
  .account-sidebar { overflow: visible; }
  .account-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav a {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: none;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    font-size: 0.78rem;
    text-align: center;
  }
  .account-nav a:hover, .account-nav a.active { padding-left: 14px; }
  .account-nav a i { font-size: 1.1rem; }
  .account-nav a .nav-count { display: none; }
  .account-content { padding: 20px; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .account-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .account-stat  { padding: 14px 10px; }
  .account-stat strong { font-size: 1.2rem; }
  .account-content { padding: 14px; }
}

/* ============================================================
   WISHLIST & COMPARE PAGES
   ============================================================ */
@media (max-width: 768px) {
  .wishlist-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wishlist-table { min-width: 520px; }
  .compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .compare-table { min-width: 600px; }
}

@media (max-width: 480px) {
  .wishlist-table th, .wishlist-table td { padding: 12px 10px; font-size: 0.82rem; }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
/* NOTE: Full page-specific responsive rules for Contact, Blog,
   Single Post, About, Auth, Track-Order live in
   assets/css/pages-responsive.css (loaded after this file) —
   that file targets the exact classes used in the real templates
   (.contact-grid, .blog-posts-grid, .blog-page-sidebar, etc). */
@media (max-width: 768px) {
  .blog-card-image { height: 180px; }
  .blog-card-body  { padding: 14px; }
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ≤ 600px */
@media (max-width: 600px) {
  .testimonials-grid { grid-template-columns: 1fr; }
  .testimonial-card  { padding: 20px; }
}

/* ============================================================
   BRANDS SECTION
   ============================================================ */
@media (max-width: 768px) {
  .brands-track { gap: 14px; justify-content: center; }
  .brand-logo   { min-width: 90px; height: 56px; padding: 10px 14px; }
  .brand-logo img { max-height: 28px; }
}

@media (max-width: 480px) {
  .brands-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .brand-logo   { min-width: unset; }
}

/* ============================================================
   NEWSLETTER SECTION
   ============================================================ */
@media (max-width: 768px) {
  .newsletter-section { padding: 44px 0; }
  .newsletter-title   { font-size: 1.6rem; }
  .newsletter-form    { flex-direction: column; gap: 10px; max-width: 100%; }
  .newsletter-input   { width: 100%; }
  .newsletter-form .btn { width: 100%; }
}

@media (max-width: 480px) {
  .newsletter-title { font-size: 1.35rem; }
  .newsletter-desc  { font-size: 0.88rem; }
}

/* ============================================================
   FOOTER
   ============================================================ */

/* ≤ 1200px */
@media (max-width: 1200px) {
  .footer-widgets { grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; }
  /* Collapse 4th widget into same row as 3rd on iPad-wide */
}

/* ≤ 1024px */
@media (max-width: 1024px) {
  .footer-widgets { grid-template-columns: 1fr 1fr; gap: 28px; }
}

/* ≤ 768px */
@media (max-width: 768px) {
  .footer-widgets { grid-template-columns: 1fr 1fr; gap: 24px; padding: 40px 0 28px; }
  .footer-widget:first-child { grid-column: 1 / -1; }
  .footer-about { font-size: 0.84rem; }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .footer-widgets { grid-template-columns: 1fr; gap: 20px; padding: 28px 0 20px; }
  .footer-widget:first-child { grid-column: auto; }
  .social-links { gap: 8px; }
}

/* Footer bottom */
@media (max-width: 600px) {
  .footer-bottom-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .footer-bottom-links { justify-content: center; flex-wrap: wrap; }
}

/* ============================================================
   CART DRAWER (MINI CART)
   ============================================================ */
@media (max-width: 480px) {
  .cart-drawer { width: 100%; right: -100%; }
  .cart-drawer.active { right: 0; }
}

/* ============================================================
   QUICK VIEW MODAL
   ============================================================ */
@media (max-width: 768px) {
  .modal-dialog { max-height: 100vh; border-radius: 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
}

@media (max-width: 480px) {
  #quick-view-content { padding: 20px !important; }
}

/* ============================================================
   PRODUCT DATA TABS — horizontal scroll on mobile
   ============================================================ */
@media (max-width: 600px) {
  .tabs-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .tabs-nav::-webkit-scrollbar { display: none; }
  .tabs-nav .tab-btn { flex-shrink: 0; padding: 12px 14px; font-size: 0.82rem; }
}

/* ============================================================
   TRACK ORDER / REGISTER / LOGIN PAGES
   ============================================================ */
@media (max-width: 600px) {
  .track-order-form    { padding: 24px 16px !important; }
  .register-form-wrap  { padding: 24px 16px !important; }
  .login-form-wrap     { padding: 24px 16px !important; }
  .auth-columns        { grid-template-columns: 1fr !important; }
}

/* ============================================================
   PAGE HEADERS / BREADCRUMBS
   ============================================================ */
@media (max-width: 600px) {
  .page-header       { padding: 28px 0 !important; }
  .page-header-title { font-size: 1.5rem !important; }
  .breadcrumb        { font-size: 0.78rem; }
}

/* ============================================================
   SEARCH RESULTS DROPDOWN
   ============================================================ */
@media (max-width: 480px) {
  .search-results-dropdown { font-size: 0.82rem; }
  .search-result-item      { padding: 10px 12px; }
  .search-result-item img  { width: 40px; height: 40px; }
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
@media (max-width: 480px) {
  #back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; font-size: 0.9rem; }
}

/* ============================================================
   WOOCOMMERCE OVERRIDES — RESPONSIVE
   ============================================================ */

/* Cart & checkout native WC forms */
@media (max-width: 768px) {
  .woocommerce-cart-form { overflow-x: auto; }
  .woocommerce table.shop_table { min-width: 480px; font-size: 0.875rem; }
  .woocommerce-checkout #payment { padding: 16px; }
  .woocommerce form .form-row { margin-bottom: 12px; }
  .col2-set .col-1,
  .col2-set .col-2 { float: none; width: 100%; }
}

@media (max-width: 480px) {
  .woocommerce table.shop_table { min-width: 380px; font-size: 0.82rem; }
  .woocommerce table.shop_table th,
  .woocommerce table.shop_table td { padding: 10px 10px; }
  .woocommerce nav.woocommerce-pagination ul { flex-wrap: wrap; gap: 4px; }
}

/* WC my-account pages */
@media (max-width: 768px) {
  .woocommerce-account .woocommerce-MyAccount-content { padding: 0; }
  .woocommerce-account table.shop_table_responsive { overflow-x: auto; display: block; }
}

/* ============================================================
   UTILITY — TOUCH TARGETS
   Ensure all interactive elements meet 44px minimum on mobile
   ============================================================ */
@media (max-width: 768px) {
  .btn, button, [role="button"],
  .nav-link, .filter-label,
  .product-action-btn, .wishlist-btn,
  .qty-btn, .vpt-qty-btn {
    min-height: 44px;
    min-width: 44px;
  }
  /* Override where explicit sizing is correct */
  .product-action-btn { min-height: 36px; min-width: 36px; }
  .icon-badge { min-height: unset; min-width: unset; }
}

/* ============================================================
   UTILITY — FOCUS VISIBLE (accessibility)
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   UTILITY — REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-float-card { animation: none; }
}

/* ============================================================
   LARGE SCREENS — 1440px+
   ============================================================ */
@media (min-width: 1440px) {
  .container { max-width: 1360px; }
  .products-grid { grid-template-columns: repeat(5, 1fr); }
  .categories-grid { grid-template-columns: repeat(6, 1fr); }
  .hero-section { padding: 100px 0; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #medishop-topbar,
  #medishop-nav,
  #mobile-menu-panel,
  .cart-drawer,
  #back-to-top,
  .newsletter-section,
  .header-icons,
  .product-actions,
  .breadcrumb { display: none !important; }

  .single-product-layout { grid-template-columns: 1fr 1fr; }
  .hero-section { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #666; }
}

/* ============================================================
   SAFE AREA INSETS — iPhone notch / Dynamic Island
   ============================================================ */
@supports (padding: env(safe-area-inset-left)) {
  .container {
    padding-left:  max(var(--container-pad), env(safe-area-inset-left));
    padding-right: max(var(--container-pad), env(safe-area-inset-right));
  }
  #medishop-topbar,
  #medishop-header,
  #medishop-nav {
    padding-left:  env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  #mobile-menu-panel {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .cart-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  #medishop-footer .footer-bottom {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* ============================================================
   SINGLE PRODUCT PAGE — FULL RESPONSIVE REBUILD
   ============================================================ */

/* ── Sticky gallery on desktop ──────────────────────── */
@media (min-width: 1025px) {
  .product-gallery {
    position: sticky;
    top: 90px;
    align-self: start;
  }
}

/* ── Gallery slider mechanics ───────────────────────── */
.product-gallery { position: relative; }

.gallery-sale-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  background: #DC3545;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(220,53,69,0.3);
}

.gallery-zoom-hint {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  pointer-events: none;
}

.gallery-main { position: relative; overflow: hidden; padding: 0 !important; }
.gallery-track {
  display: flex;
  transition: transform 0.35s ease;
  width: 100%;
  height: 100%;
}
.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.gallery-slide img {
  max-height: 380px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.gallery-main.zoomed .gallery-slide.active img {
  transform: scale(1.6);
  cursor: zoom-out;
}
.gallery-main:not(.zoomed) { cursor: zoom-in; }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.gallery-nav:hover { background: var(--primary); color: #fff; }
.gallery-nav-prev { left: 12px; }
.gallery-nav-next { right: 12px; }

.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 6;
}
.gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}
.gallery-dot.active { background: var(--primary); width: 18px; border-radius: 4px; }

/* Hide nav arrows on desktop where thumbnails already work well;
   keep visible on touch/mobile where swipe + arrows both help */
@media (min-width: 1025px) {
  .gallery-nav { opacity: 0; }
  .product-gallery:hover .gallery-nav { opacity: 1; }
  .gallery-dots { display: none; }
}

/* ── Tablet & mobile gallery sizing ─────────────────── */
@media (max-width: 1024px) {
  .gallery-slide { min-height: 320px; }
  .gallery-slide img { max-height: 320px; }
}

@media (max-width: 768px) {
  .gallery-slide { min-height: 280px; padding: 14px; }
  .gallery-slide img { max-height: 280px; }
  .gallery-nav { width: 34px; height: 34px; font-size: 0.8rem; }
  .gallery-dots { display: flex; }
  .gallery-thumbs {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .gallery-thumb { scroll-snap-align: start; width: 60px; height: 60px; }
}

@media (max-width: 480px) {
  .gallery-slide { min-height: 240px; padding: 10px; }
  .gallery-slide img { max-height: 240px; }
  .gallery-sale-badge { font-size: 0.72rem; padding: 4px 10px; top: 10px; left: 10px; }
  .gallery-zoom-hint { width: 30px; height: 30px; font-size: 0.75rem; top: 10px; right: 10px; }
  .gallery-thumb { width: 52px; height: 52px; }
}

/* ── Product info text scaling ──────────────────────── */
@media (max-width: 768px) {
  .product-info .product-title { font-size: 1.3rem; line-height: 1.35; }
  .product-info .product-category-tag { font-size: 0.76rem; }
  .product-excerpt { font-size: 0.88rem; }
}

@media (max-width: 480px) {
  .product-info .product-title { font-size: 1.15rem; }
  .product-price-block { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .product-price-block .price-current { font-size: 1.3rem; }
  .product-price-block > span:last-child { margin-left: 0 !important; order: 3; flex-basis: 100%; }
}

/* ── Variation buttons wrap better on small screens ──── */
@media (max-width: 480px) {
  .variation-options { gap: 6px; }
  .variation-btn { padding: 7px 12px; font-size: 0.78rem; }
  .variation-btn.swatch { width: 32px; height: 32px; }
}

/* ── Quantity + Add to Cart row ──────────────────────── */
@media (max-width: 600px) {
  .product-add-cart {
    flex-wrap: wrap;
    gap: 10px;
  }
  .quantity-wrap { flex: 0 0 auto; }
  .product-add-cart .btn-add-cart {
    flex: 1 1 100%;
    order: 3;
    height: 48px !important;
  }
  .product-add-cart .btn-buy-now {
    flex: 1 1 calc(50% - 5px);
    order: 2;
    justify-content: center;
    padding: 0 16px;
  }
  .quantity-wrap { flex: 1 1 calc(50% - 5px); justify-content: center; order: 1; }
  .qty-input { width: 100%; }
}

@media (max-width: 360px) {
  .product-add-cart .btn-buy-now span,
  .quantity-wrap { font-size: 0.85rem; }
}

/* ── Product meta + actions row ─────────────────────── */
@media (max-width: 480px) {
  .product-meta { padding: 12px; font-size: 0.78rem; }
  .product-meta span { flex-wrap: wrap; }
  .product-actions-row .btn { min-width: 0; font-size: 0.78rem; padding: 9px 10px; }
  .product-actions-row .btn span,
  .product-actions-row .btn { white-space: nowrap; }
}

@media (max-width: 360px) {
  .product-actions-row { gap: 8px; }
  .product-actions-row .btn:nth-child(3) { display: none; } /* hide Share on very small screens */
}

/* ============================================================
   STICKY MOBILE ADD-TO-CART BAR
   ============================================================ */
.sticky-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100px;
  z-index: 998;
  background: var(--white);
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  transition: bottom 0.3s ease;
}
.sticky-cart-bar.visible { bottom: 0; }

.sticky-cart-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.sticky-cart-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: contain;
  background: var(--light-bg);
  border: 1px solid var(--border);
  padding: 3px;
  flex-shrink: 0;
}
.sticky-cart-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sticky-cart-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sticky-cart-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}
.sticky-cart-btn {
  flex-shrink: 0;
  height: 42px !important;
  padding: 0 18px !important;
  font-size: 0.85rem !important;
  border-radius: var(--radius) !important;
  white-space: nowrap;
}

/* Only show this bar on tablet/mobile widths where it's useful */
@media (min-width: 1025px) {
  .sticky-cart-bar { display: none !important; }
}

@media (max-width: 480px) {
  .sticky-cart-text { display: none; }
  .sticky-cart-btn { flex: 1; justify-content: center; }
}

/* ============================================================
   PRODUCT DATA TABS — responsive polish
   ============================================================ */
@media (max-width: 768px) {
  .product-data-tabs { padding: 30px 0; }
}

@media (max-width: 600px) {
  .product-data-tabs { padding: 24px 0 60px; } /* extra bottom padding so sticky bar doesn't cover content */
  .tabs-nav { margin-bottom: 20px; }
  .tabs-nav .tab-btn { padding: 11px 16px; font-size: 0.8rem; }
}

/* Add bottom padding to whole page when sticky bar is visible, to avoid overlap */
@media (max-width: 1024px) {
  body.has-sticky-cart { padding-bottom: 64px; }
}

/* ============================================================
   RELATED PRODUCTS HEADING — responsive
   ============================================================ */
@media (max-width: 600px) {
  div[style*="padding:50px 0"] h2 { font-size: 1.15rem !important; margin-bottom: 16px !important; }
}

/* ============================================================
   MINI-CART DRAWER — per-line qty and remove controls
   ============================================================ */
.mini-cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: opacity .18s ease;
}
.mini-cart-item:last-child { border-bottom: none; }
.mini-cart-item-loading   { opacity: .5; pointer-events: none; }

.mini-cart-thumb {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface, #f2f4f6);
}

.mini-cart-info      { min-width: 0; }
.mini-cart-name      {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1d2327);
  text-decoration: none;
  line-height: 1.35;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mini-cart-name:hover { color: var(--primary); }
.mini-cart-price     { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }

.mini-cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  height: 28px;
}
.mini-cart-qty-btn {
  border: 0;
  background: transparent;
  width: 26px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary, #555);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.mini-cart-qty-btn:hover { background: var(--surface, #f2f4f6); color: var(--primary); }
.mini-cart-qty-val {
  width: 34px;
  border: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  padding: 0;
  height: 100%;
  -moz-appearance: textfield;
}
.mini-cart-qty-val::-webkit-outer-spin-button,
.mini-cart-qty-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.mini-cart-remove {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  color: var(--text-secondary, #888);
  transition: background .12s ease, color .12s ease;
  align-self: flex-start;
  text-decoration: none;
  font-size: 11px;
}
.mini-cart-remove:hover { background: #fbeaea; color: #c53030; }

.mini-cart-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary, #666);
}
.mini-cart-empty .fas { font-size: 2.6rem; color: var(--border); display: block; margin-bottom: 12px; }

/* ============================================================
   PRODUCT PAGE — mobile responsiveness
   ============================================================ */
@media (max-width: 900px) {
  .single-product-layout { grid-template-columns: 1fr !important; gap: 24px; }
}
@media (max-width: 768px) {
  .single-product-layout { padding: 16px 0; }
  .product-gallery       { max-width: 100%; }
  .product-info          { padding: 0 4px; }
  .product-title         { font-size: 1.4rem; line-height: 1.3; }
  .product-price-block   { flex-wrap: wrap; row-gap: 8px; align-items: baseline; }
  .product-actions-row   { flex-wrap: wrap; gap: 10px; }
  .product-actions-row .btn { flex: 1 1 auto; min-width: 140px; }
}
@media (max-width: 480px) {
  .product-title         { font-size: 1.2rem; }
  .product-price-block   { font-size: 0.95rem; }
  .product-actions-row .btn { min-width: 100%; }
  .product-tabs .tab-btn { padding: 10px 12px; font-size: 12px; }
  .gallery-thumbs        { gap: 6px; }
  .gallery-thumb         { width: 54px; height: 54px; }
}
@media (max-width: 375px) {
  .product-title         { font-size: 1.1rem; }
  .gallery-thumb         { width: 48px; height: 48px; }
  .product-meta          { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ============================================================
   PRODUCT REVIEWS TAB — style WooCommerce's default markup
   (WooCommerce renders .commentlist, .comment, #respond, etc.
   inside #tab-reviews; without these rules it looked unstyled.)
   ============================================================ */
#tab-reviews #reviews { margin-top: 8px; }

#tab-reviews h2,
#tab-reviews h3      { font-size: 1.15rem; margin: 0 0 14px; color: var(--text-primary); font-weight: 600; }

#tab-reviews .woocommerce-noreviews {
  padding: 18px 20px;
  background: #f7fbfa;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

#tab-reviews .commentlist,
#tab-reviews ol.commentlist   { list-style: none; padding: 0; margin: 0 0 28px; }
#tab-reviews .commentlist li  { list-style: none; margin: 0 0 16px; padding: 0; }

#tab-reviews .comment_container {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
#tab-reviews .comment_container img.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #f2f4f6;
}
#tab-reviews .comment-text        { min-width: 0; }
#tab-reviews .meta                { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; }
#tab-reviews .meta strong         { color: var(--text-primary); font-size: 14px; font-weight: 600; }
#tab-reviews .description         { color: var(--text-primary); font-size: 14px; line-height: 1.6; }
#tab-reviews .description p:last-child { margin-bottom: 0; }

/* Star rating (both displayed and input) */
#tab-reviews .star-rating,
#tab-reviews p.stars              { color: #f0b429; }
#tab-reviews .star-rating         {
  display: inline-block;
  position: relative;
  overflow: hidden;
  height: 1.2em;
  line-height: 1.2;
  font-size: 14px;
  font-family: star;
  margin: 0 0 6px;
}

/* Review form */
#tab-reviews #respond {
  margin-top: 24px;
  padding: 20px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
#tab-reviews #reply-title,
#tab-reviews #respond h3          { margin: 0 0 12px; font-size: 1.05rem; }
#tab-reviews .comment-notes       { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; }
#tab-reviews .comment-form-rating { margin-bottom: 14px; }
#tab-reviews .comment-form-rating label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
#tab-reviews p.stars              { font-size: 20px; }

#tab-reviews .comment-form-comment,
#tab-reviews .comment-form-author,
#tab-reviews .comment-form-email  { margin-bottom: 14px; }
#tab-reviews .comment-form label  { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--text-primary); }
#tab-reviews .comment-form input[type="text"],
#tab-reviews .comment-form input[type="email"],
#tab-reviews .comment-form input[type="url"],
#tab-reviews .comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
#tab-reviews .comment-form textarea { min-height: 110px; resize: vertical; }
#tab-reviews .comment-form input:focus,
#tab-reviews .comment-form textarea:focus {
  outline: none;
  border-color: var(--primary, #2da95c);
  box-shadow: 0 0 0 3px rgba(45,169,92,.14);
}
#tab-reviews .form-submit .submit,
#tab-reviews #submit {
  background: var(--primary, #034b4b);
  color: #fff;
  border: 0;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease;
}
#tab-reviews .form-submit .submit:hover,
#tab-reviews #submit:hover { background: #023838; }

@media (max-width: 480px) {
  #tab-reviews .comment_container { grid-template-columns: 40px 1fr; gap: 10px; padding: 12px; }
  #tab-reviews .comment_container img.avatar { width: 36px; height: 36px; }
  #tab-reviews #respond           { padding: 14px; }
}

/* ============================================================
   PRODUCT PAGE — expanded mobile responsive coverage
   ============================================================ */
@media (max-width: 900px) {
  .single-product-layout { grid-template-columns: 1fr !important; gap: 22px; }
  .product-gallery       { position: static; }
  .product-info          { position: static; padding-top: 4px; }
}

@media (max-width: 768px) {
  .product-title       { font-size: 1.35rem; line-height: 1.3; margin: 6px 0; }
  .product-category-tag{ font-size: 12px; }
  .product-price-block { flex-wrap: wrap; row-gap: 6px; align-items: baseline; margin-bottom: 10px; }
  .product-excerpt     { font-size: 14px; line-height: 1.55; }

  /* Variations selector */
  .product-variations .variation-btn { padding: 8px 12px; font-size: 13px; }

  /* Wishlist/Compare/Share row */
  .product-actions-row       { flex-wrap: wrap; gap: 8px; }
  .product-actions-row .btn  { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 9px 10px; font-size: 12px; }

  /* Meta list */
  .product-meta            { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 13px; }
  .product-meta span       { display: block; }

  /* Trust badges */
  .product-trust           { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-trust-item      { padding: 10px 8px; font-size: 12px; }
  .product-trust-item i    { font-size: 20px; }
  .product-trust-item strong { font-size: 13px; }

  /* Simple-product add-to-cart row */
  .product-add-cart        { flex-wrap: wrap; gap: 10px; }
  .quantity-wrap           { flex: 0 0 auto; }
  .btn-add-cart            { flex: 1 1 auto !important; min-width: 140px; }
  .btn-buy-now             { flex: 1 1 100%; margin-top: 4px; }
}

@media (max-width: 480px) {
  .product-title       { font-size: 1.15rem; }
  .product-price-block .price-current { font-size: 1.2rem; }

  .product-actions-row .btn { flex: 1 1 100%; }

  .product-tabs .tab-btn { padding: 10px 12px; font-size: 12px; }
  .product-tabs          { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .product-tabs::-webkit-scrollbar { display: none; }

  /* Gallery thumbnails horizontal scroll */
  .gallery-thumbs        { overflow-x: auto; flex-wrap: nowrap; scroll-snap-type: x mandatory; }
  .gallery-thumbs::-webkit-scrollbar { display: none; }
  .gallery-thumb         { width: 54px; height: 54px; flex: 0 0 54px; scroll-snap-align: start; }

  /* Sticky mobile bar tightens up */
  .sticky-cart-bar       { padding: 8px 12px; gap: 10px; }
  .sticky-cart-thumb     { width: 40px; height: 40px; }
  .sticky-cart-title     { font-size: 13px; }
  .sticky-cart-price     { font-size: 12px; }
  .sticky-cart-btn       { padding: 10px 14px; font-size: 13px; white-space: nowrap; }
}

@media (max-width: 375px) {
  .product-title         { font-size: 1.05rem; }
  .gallery-thumb         { width: 48px; height: 48px; flex-basis: 48px; }
  .product-trust         { grid-template-columns: 1fr; }
  .product-actions-row .btn { font-size: 11px; padding: 8px; }
}

/* Zoom-hint styling lives higher up in this file (original rule).
   The earlier duplicate override was removed — it fought the original
   and pushed the icon to the top-left with poor contrast. */


/* ============================================================
   PRODUCT CARDS — equal height, footer buttons aligned
   Fixes: when card titles wrap 2 lines in one card and 1 line
   in another, the "Select Options" / "Add to Cart" buttons end
   up on different vertical positions across a row (screenshot 3).
   Now the body grows to fill and the footer sits at the bottom.
   ============================================================ */
.products-grid { align-items: stretch; }
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.product-card-image { flex-shrink: 0; }
.product-card-body  { flex: 1 1 auto; display: flex; flex-direction: column; }
.product-card-footer {
  margin-top: auto;
  padding-top: 8px;
}
/* Clamp title to 2 lines so vertical space is predictable */
.product-card .product-card-title,
.product-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;   /* reserves 2 lines even for short titles */
  line-height: 1.3;
}

/* ============================================================
   PRODUCT REVIEWS — use #reviews (not #tab-reviews) so these
   rules win against WooCommerce's built-in .woocommerce styles.
   Also handle the case where the review UI is rendered directly
   (no #tab-reviews wrapper).
   ============================================================ */
#reviews { margin-top: 8px; }
#reviews h2,
#reviews h3,
#reviews #reply-title {
  font-size: 1.15rem;
  margin: 0 0 14px;
  color: var(--text-primary);
  font-weight: 600;
}
#reviews .woocommerce-noreviews {
  padding: 16px 20px;
  background: #f4faf9;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary, #2da95c);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 22px;
}

/* Comment list */
#reviews ol.commentlist,
#reviews .commentlist { list-style: none; padding: 0; margin: 0 0 24px; }
#reviews .commentlist li { list-style: none; margin: 0 0 14px; padding: 0; }
#reviews .comment_container {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
#reviews .comment_container img.avatar,
#reviews img.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #f2f4f6;
  margin: 0;
}
#reviews .comment-text        { min-width: 0; }
#reviews .meta                { font-size: 12px; color: var(--text-secondary); margin: 0 0 6px; }
#reviews .meta strong         { color: var(--text-primary); font-size: 14px; font-weight: 600; display: block; }
#reviews .description         { color: var(--text-primary); font-size: 14px; line-height: 1.6; }
#reviews .description p:last-child { margin-bottom: 0; }

/* Review form — the block from Image 1 */
#reviews #respond,
#respond.comment-respond {
  margin-top: 8px;
  padding: 22px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 12px;
}
#reviews #respond p.comment-notes {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

/* Star rating input */
#reviews .comment-form-rating {
  margin-bottom: 18px;
}
#reviews .comment-form-rating label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
#reviews p.stars {
  font-size: 22px;
  line-height: 1;
  margin: 0;
}
#reviews p.stars a         { color: #f0b429; }
#reviews p.stars a:hover   { color: #d69812; }
#reviews p.stars.selected a.active ~ a { color: #d6dae0; }

/* Text fields */
#reviews .comment-form-comment,
#reviews .comment-form-author,
#reviews .comment-form-email {
  margin-bottom: 16px;
}
#reviews .comment-form label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-primary);
}
#reviews .comment-form input[type="text"],
#reviews .comment-form input[type="email"],
#reviews .comment-form input[type="url"],
#reviews .comment-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  color: var(--text-primary);
}
#reviews .comment-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
#reviews .comment-form input:focus,
#reviews .comment-form textarea:focus {
  outline: none;
  border-color: var(--primary, #2da95c);
  box-shadow: 0 0 0 3px rgba(45,169,92,.15);
}

/* Cookie consent checkbox row */
#reviews .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
#reviews .comment-form-cookies-consent input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
#reviews .comment-form-cookies-consent label {
  display: inline;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}

/* Submit button */
#reviews .form-submit { margin: 8px 0 0; }
#reviews .form-submit .submit,
#reviews #submit {
  background: var(--primary, #034b4b) !important;
  color: #fff !important;
  border: 0 !important;
  padding: 12px 28px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  min-width: 140px;
}
#reviews .form-submit .submit:hover,
#reviews #submit:hover {
  background: #023838 !important;
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  #reviews .comment_container { grid-template-columns: 40px 1fr; gap: 10px; padding: 12px; }
  #reviews .comment_container img.avatar,
  #reviews img.avatar         { width: 36px; height: 36px; }
  #reviews #respond,
  #respond.comment-respond    { padding: 16px; }
  #reviews #submit            { width: 100%; }
}

/* ============================================================
   HOMEPAGE HERO — Custom banner image mode
   Used when Customizer → Homepage Hero / Banner → Display Mode
   is set to "Custom banner image". Different from the default
   hero section which uses text + illustration side by side.
   ============================================================ */
.hero-section-banner {
  padding: 24px 0;
  background: transparent;
}
.hero-section-banner .container {
  max-width: 1280px;
}
.hero-banner-link {
  display: block;
  transition: transform .18s ease, box-shadow .18s ease;
}
.hero-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(3,59,74,.12);
}
.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
}
@media (max-width: 768px) {
  .hero-section-banner { padding: 16px 0; }
  .hero-banner-img     { border-radius: 12px; }
}
@media (max-width: 480px) {
  .hero-section-banner { padding: 12px 0; }
  .hero-banner-img     { border-radius: 10px; }
}

/* ============================================================
   CUSTOM PAYMENT GATEWAYS — thank-you page display
   Rendered by MediShop_Gateway_Bank / _Card / _Crypto after
   the customer places an order. Fully responsive.
   ============================================================ */
.medishop-payment-details {
  background: #fff;
  border: 1px solid var(--border, #e2e6eb);
  border-radius: 12px;
  padding: 22px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(3,59,74,.05);
}
.medishop-payment-details h3 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  color: var(--secondary, #034b4b);
  border-bottom: 2px solid var(--primary, #2da95c);
  padding-bottom: 8px;
  display: inline-block;
}
.medishop-order-ref {
  background: #f4faf9;
  border-left: 3px solid var(--primary, #2da95c);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 16px;
  font-size: 14px;
}
.medishop-order-ref strong {
  color: var(--primary, #2da95c);
  font-size: 15px;
}

/* ── Bank Transfer table ─────────────────────────────────── */
.medishop-bank-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}
.medishop-bank-table th,
.medishop-bank-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.medishop-bank-table th {
  width: 40%;
  background: #fafbfc;
  color: var(--text-secondary);
  font-weight: 600;
}
.medishop-bank-table td {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

/* ── Card: response-time / next-steps ─────────────────────── */
.medishop-payment-note {
  background: #fafbfc;
  border-radius: 8px;
  padding: 16px;
  line-height: 1.6;
  color: var(--text-primary);
}
.medishop-response-time {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}
.medishop-response-time i { color: var(--primary); margin-right: 6px; }

/* ── Crypto: grid of coin cards with QR ──────────────────── */
.medishop-crypto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 12px 0 14px;
}
.medishop-crypto-card {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.medishop-crypto-card h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--secondary);
}
.medishop-crypto-qr {
  display: block;
  margin: 0 auto 12px;
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  border: 1px solid var(--border);
}
.medishop-crypto-addr { text-align: left; }
.medishop-crypto-addr label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
.medishop-crypto-addr-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}
.medishop-crypto-addr-row code {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--text-primary);
  word-break: break-all;
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  line-height: 1.4;
}
.medishop-copy-addr {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: background .15s ease;
}
.medishop-copy-addr:hover { background: var(--secondary); }

.medishop-payment-extra {
  background: #fef7e0;
  border-left: 3px solid #f0b429;
  padding: 12px 14px;
  border-radius: 4px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #5a4700;
}
.medishop-payment-extra p:last-child { margin-bottom: 0; }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 640px) {
  .medishop-payment-details { padding: 16px; margin: 18px 0; }
  .medishop-payment-details h3 { font-size: 0.98rem; }
  .medishop-bank-table th,
  .medishop-bank-table td { padding: 8px 10px; font-size: 12px; }
  .medishop-bank-table th { width: 42%; }
  .medishop-crypto-grid { grid-template-columns: 1fr; gap: 12px; }
  .medishop-crypto-card { padding: 14px; }
  .medishop-crypto-qr { max-width: 160px; }
}
@media (max-width: 380px) {
  .medishop-crypto-qr { max-width: 140px; }
  .medishop-crypto-addr-row code { font-size: 10px; }
}

/* ============================================================
   DOCTOR CREDENTIAL BADGES — "Medically Reviewed by / Written by"
   Rendered above the product description. Hover/click reveals a
   card with photo, name, specialty, and a "View more" link.
   ============================================================ */
.ms-doctor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
}
.ms-doc-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f4faf9;
  border: 1px solid var(--border, #e2e6eb);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary, #55606c);
  line-height: 1.4;
  cursor: default;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ms-doc-badge:hover {
  border-color: var(--primary, #2da95c);
  box-shadow: 0 2px 6px rgba(45,169,92,.12);
}
.ms-doc-badge-check {
  color: var(--primary, #2da95c);
  font-size: 14px;
  display: inline-flex;
}
.ms-doc-badge-label { color: var(--text-secondary, #55606c); }
.ms-doc-badge-name {
  color: var(--secondary, #034b4b);
  font-weight: 600;
  text-decoration: none;
  transition: color .15s ease;
}
.ms-doc-badge-name:hover { color: var(--primary, #2da95c); }

/* Hover popup card */
.ms-doc-card {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--border, #e2e6eb);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(3,59,74,.14), 0 4px 12px rgba(0,0,0,.06);
  padding: 16px;
  display: none;
  z-index: 100;
  gap: 14px;
  align-items: flex-start;
}
.ms-doc-badge:hover .ms-doc-card,
.ms-doc-badge:focus-within .ms-doc-card,
.ms-doc-badge.is-open .ms-doc-card {
  display: flex;
}
.ms-doc-card-photo {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f2f4f6;
}
.ms-doc-card-body { flex: 1 1 auto; min-width: 0; }
.ms-doc-card-trusted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #2da95c);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.ms-doc-card-trusted i { font-size: 13px; }
.ms-doc-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary, #034b4b);
  margin-bottom: 4px;
  line-height: 1.3;
}
.ms-doc-card-specialty {
  font-size: 13px;
  color: var(--text-secondary, #55606c);
  line-height: 1.4;
  margin-bottom: 8px;
}
.ms-doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--text-secondary, #55606c);
  margin-bottom: 10px;
}
.ms-doc-card-meta span {
  background: #f4faf9;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--secondary, #034b4b);
}
.ms-doc-card-more {
  display: inline-block;
  color: var(--primary, #2da95c);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.ms-doc-card-more:hover { color: var(--secondary, #034b4b); }

@media (max-width: 640px) {
  .ms-doctor-row { gap: 8px; margin-bottom: 18px; }
  .ms-doc-badge {
    padding: 7px 12px;
    font-size: 13px;
    /* Badges stack full-width on phones so both fit cleanly */
    flex-basis: 100%;
  }
  .ms-doc-card {
    /* Anchor to the viewport edges so the popup never spills off-screen */
    left: 8px;
    right: 8px;
    min-width: 0;
    max-width: none;
    padding: 14px;
    gap: 12px;
  }
  .ms-doc-card-photo { width: 68px; height: 68px; border-radius: 10px; }
  .ms-doc-card-name  { font-size: 15px; }
}
