:root {
    /* CANONICAL SHOP CSS: shop.html and shop-fr.html load this file. */
    --green-50: #F0FDF4;
    --green-100: #DCFCE7;
    --green-600: #15803D;
    --green-700: #116A32;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --red-500: #EF4444;
    --amber-500: #F59E0B;
  }

  .shop-page {
    padding: 0;
    background: linear-gradient(180deg, #F9FAFB 0%, #fff 120px, #fff 100%);
  }

  .shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
  }

  /* SD1: Shop Header — entrance animation */
  .shop-header {
    padding: 40px 0 24px;
    animation: shopHeaderIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes shopHeaderIn {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .shop-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--gray-900);
    margin: 0 0 6px;
  }
  .shop-header p {
    font-size: 15px;
    color: var(--gray-500);
    margin: 0;
    animation: shopHeaderIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
  }

  /* SD2: Search bar — glassmorphism + entrance */
  .shop-search {
    margin-bottom: 16px;
    position: relative;
    animation: shopHeaderIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
  }
  .shop-search input {
    width: 100%;
    max-width: 400px;
    padding: 11px 18px 11px 40px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-sizing: border-box;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .shop-search::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: currentColor;
    opacity: 0.35;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    z-index: 2;
    pointer-events: none;
    color: var(--gray-400);
    transition: opacity 0.3s;
  }
  .shop-search:focus-within::before {
    opacity: 0.6;
    color: var(--green-600);
  }
  .shop-search input:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 4px rgba(21,128,61,0.08), 0 4px 16px rgba(21,128,61,0.06);
    background: #fff;
  }
  .shop-search input::placeholder {
    color: var(--gray-400);
  }
  .search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: 400px;
    background: #fff;
    border-radius: 0 0 10px 10px;
    border: 1px solid var(--gray-200);
    border-top: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 100;
  }
  .search-suggestions.active {
    max-height: 300px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: var(--green-600);
  }
  .search-suggestion-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    border-bottom: 1px solid var(--gray-50);
  }
  .search-suggestion-item:hover {
    background: var(--green-50);
  }
  .search-suggestion-item:last-child {
    border-bottom: none;
  }

  /* SD3: Category pills — enhanced design */
  .shop-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
    animation: shopHeaderIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
  }
  .shop-cat {
    padding: 7px 16px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #475569;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: 'Open Sans', sans-serif;
  }
  .shop-cat:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .shop-cat.active {
    background: linear-gradient(135deg, var(--green-600), #1a9a4a);
    border-color: var(--green-600);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(21,128,61,0.25);
    transform: translateY(-2px);
  }

  /* Category hover thumbnail tooltip */
  .cat-tooltip {
    position: absolute;
    z-index: 1000;
    width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid var(--gray-100);
  }
  .cat-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .cat-tooltip-img {
    width: 100%;
    height: 130px;
    overflow: hidden;
  }
  .cat-tooltip-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .cat-tooltip-label {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    font-family: 'Open Sans', sans-serif;
    text-align: center;
  }

  .shop-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  /* SD4: Product list staggered entrance */
  .shop-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(21,128,61,0.04), 0 6px 20px rgba(15,23,42,0.06);
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s cubic-bezier(0.22,1,0.36,1);
    animation: shopItemIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes shopItemIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  /* Staggered delays for first 30 items */
  .shop-item:nth-child(1) { animation-delay: 0.25s; }
  .shop-item:nth-child(2) { animation-delay: 0.3s; }
  .shop-item:nth-child(3) { animation-delay: 0.35s; }
  .shop-item:nth-child(4) { animation-delay: 0.4s; }
  .shop-item:nth-child(5) { animation-delay: 0.45s; }
  .shop-item:nth-child(6) { animation-delay: 0.5s; }
  .shop-item:nth-child(7) { animation-delay: 0.55s; }
  .shop-item:nth-child(8) { animation-delay: 0.6s; }
  .shop-item:nth-child(9) { animation-delay: 0.65s; }
  .shop-item:nth-child(10) { animation-delay: 0.7s; }
  .shop-item:nth-child(11) { animation-delay: 0.74s; }
  .shop-item:nth-child(12) { animation-delay: 0.78s; }
  .shop-item:nth-child(13) { animation-delay: 0.82s; }
  .shop-item:nth-child(14) { animation-delay: 0.86s; }
  .shop-item:nth-child(15) { animation-delay: 0.9s; }
  .shop-item:nth-child(16) { animation-delay: 0.93s; }
  .shop-item:nth-child(17) { animation-delay: 0.96s; }
  .shop-item:nth-child(18) { animation-delay: 0.99s; }
  .shop-item:nth-child(19) { animation-delay: 1.02s; }
  .shop-item:nth-child(20) { animation-delay: 1.05s; }
  .shop-item:nth-child(21) { animation-delay: 1.07s; }
  .shop-item:nth-child(22) { animation-delay: 1.09s; }
  .shop-item:nth-child(23) { animation-delay: 1.11s; }
  .shop-item:nth-child(24) { animation-delay: 1.13s; }
  .shop-item:nth-child(25) { animation-delay: 1.15s; }
  .shop-item:nth-child(26) { animation-delay: 1.16s; }
  .shop-item:nth-child(27) { animation-delay: 1.17s; }
  .shop-item:nth-child(28) { animation-delay: 1.18s; }
  .shop-item:nth-child(29) { animation-delay: 1.19s; }
  .shop-item:nth-child(30) { animation-delay: 1.2s; }
  .shop-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 12px rgba(21,128,61,0.12), 0 12px 36px rgba(21,128,61,0.10);
  }
  .shop-item-thumb {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    flex-shrink: 0;
    display: flex;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .shop-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
  }
  .shop-item:hover .shop-item-thumb img {
    transform: scale(1.06);
  }
  .shop-item-info {
    flex: 1;
    min-width: 0;
  }
  .shop-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 2px;
  }
  .shop-item-spec {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0 0 2px;
  }
  .shop-item-extra {
    font-size: 12px;
    color: var(--gray-400);
    margin: 0;
  }
  .shop-item-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--green-50);
    color: var(--green-600);
    margin-left: 8px;
  }
  .shop-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    color: #EA580C;
    margin-left: 6px;
    border: 1px solid #FED7AA;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
  .shop-item-badge .badge-icon {
    font-size: 12px;
    line-height: 1;
  }
  .shop-item.volume-item {
    border-left: 3px solid #EA580C;
    background: linear-gradient(90deg, #FFF7ED 0%, #fff 15%, #fff 100%);
  }
  .shop-item.removing {
    border-color: #FCA5A5 !important;
    background: linear-gradient(90deg, #FEF2F2 0%, #fff 30%, #fff 100%) !important;
    border-left: 3px solid #EF4444 !important;
    animation: removePulse 0.6s ease-in-out 3;
  }
  @keyframes removePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  }
  @keyframes cartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
  }
  .cart-pulse { animation: cartPulse 0.4s ease; }
  .shop-item-price {
    text-align: right;
    flex-shrink: 0;
    min-width: 90px;
  }
  @keyframes priceFlash {
    0% { color: var(--green-600); transform: scale(1.05); }
    100% { color: inherit; transform: scale(1); }
  }
  .price-flash { animation: priceFlash 0.6s ease; }
  .shop-item-price .price {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
  }
  .shop-item-price .unit {
    font-size: 12px;
    color: var(--gray-400);
  }
  .shop-item-qty {
    flex-shrink: 0;
  }
  .shop-item-qty input {
    width: 64px;
    height: 36px;
    padding: 8px 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
  }
  .shop-item-qty input:focus {
    border-color: var(--green-600);
  }
  .shop-item-qty input.qty-zero {
    border-color: #EF4444;
    background: #FEF2F2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  }
  .shop-item-qty .qty-label {
    display: block;
    font-size: 10px;
    color: var(--gray-400);
    text-align: center;
    margin-top: 3px;
  }
  .shop-item-qty-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .shop-item-add {
    flex-shrink: 0;
  }
  .btn-minus {
    min-width: 36px;
    height: 36px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--gray-500);
    font-family: 'Open Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    line-height: 1;
  }
  .btn-minus:hover {
    border-color: var(--green-600);
    background: #f0fdf4;
    color: var(--gray-700);
    transform: scale(1.05);
  }
  .btn-minus:active {
    transform: scale(0.92);
    background: #dcfce7;
  }
  /* SD5: Add button — gradient green + glow */
  .btn-add {
    padding: 9px 20px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, var(--green-600), #1a9a4a);
    color: #fff;
    box-shadow: 0 2px 8px rgba(21,128,61,0.2);
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
  }
  .btn-add::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
  }
  .btn-add:hover {
    background: linear-gradient(135deg, var(--green-700), #15803d);
    box-shadow: 0 4px 20px rgba(21,128,61,0.35);
    transform: translateY(-2px);
  }
  .btn-add:hover::after { opacity: 1; }
  .btn-add.in-cart {
    background: var(--gray-100);
    color: var(--gray-500);
  }
  .btn-add.in-cart:hover {
    background: var(--gray-200);
  }

  .shop-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
  }

  /* SD5: Skeleton Loading — gradient shimmer */
  .skeleton-card {
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: none;
  }
  .skeleton-card .img-placeholder {
    height: 180px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 800px 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
  }
  .skeleton-card .text-line {
    height: 14px;
    margin: 12px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 800px 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
    border-radius: 4px;
  }
  .skeleton-card .text-line.short {
    width: 60%;
  }
  @keyframes skeletonShimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
  }

  /* SD6: Cart bar — glassmorphism */
  .shop-cart-bar {
    position: sticky;
    bottom: 24px;
    z-index: 1000;
    margin-top: 32px;
    padding: 14px 24px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.06);
    animation: cartBarIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
  }
  @keyframes cartBarIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .shop-cart-bar .cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94A3B8;
    font-size: 14px;
  }
  .shop-cart-bar .cart-count {
    background: var(--green-600);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
  }
  .shop-cart-bar .cart-total {
    flex: 1;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
  }
  .shop-cart-bar .cart-total span {
    color: #94A3B8;
    font-weight: 400;
    font-size: 12px;
    margin-left: 6px;
  }
  .btn-view-cart {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Open Sans', sans-serif;
    background: linear-gradient(135deg, var(--green-600), #1a9a4a);
    color: #fff;
    box-shadow: 0 2px 12px rgba(21,128,61,0.3);
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .btn-view-cart:hover {
    background: linear-gradient(135deg, var(--green-700), #15803d);
    box-shadow: 0 4px 20px rgba(21,128,61,0.4);
    transform: translateY(-2px);
  }

  .shop-footer {
    padding: 24px 0;
    margin-top: 32px;
    text-align: center;
    border-top: 1px solid var(--gray-100);
  }
  .shop-footer p {
    font-size: 12px;
    color: var(--gray-400);
    margin: 0 0 12px;
  }
  .shop-footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
  }
  .shop-footer-links a {
    font-size: 13px;
    color: var(--slate-500);
    text-decoration: none;
  }
  .shop-footer-links a:hover {
    color: var(--green-600);
  }

  /* ===== Cart Popup Modal ===== */
  .cart-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .cart-popup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .cart-popup {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(21,128,61,0.08);
    border-radius: 16px;
    width: 520px;
    max-width: 94vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(21,128,61,0.06), 0 4px 16px rgba(21,128,61,0.08);
    transform: translateY(16px);
    transition: transform 0.3s;
    position: absolute;
    bottom: 24px;
    right: 24px;
  }
  .cart-popup-overlay.visible .cart-popup {
    transform: translateY(0);
  }
  .cart-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--gray-100);
  }
  .cart-popup-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .cart-popup-header .popup-count {
    background: var(--green-600);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
  }
  .cart-popup-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    font-family: 'Open Sans', sans-serif;
    transition: color 0.2s;
  }
  .cart-popup-close:hover {
    color: var(--gray-700);
  }
  .cart-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 24px;
  }
  .cart-popup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-50);
    animation: cardEnter 0.4s ease both;
  }
  .cart-popup-item:nth-child(1) { animation-delay: 0.05s; }
  .cart-popup-item:nth-child(2) { animation-delay: 0.1s; }
  .cart-popup-item:nth-child(3) { animation-delay: 0.15s; }
  .cart-popup-item:nth-child(4) { animation-delay: 0.2s; }
  .cart-popup-item:nth-child(5) { animation-delay: 0.25s; }
  .cart-popup-item:nth-child(6) { animation-delay: 0.3s; }
  .cart-popup-item:nth-child(7) { animation-delay: 0.35s; }
  .cart-popup-item:nth-child(8) { animation-delay: 0.4s; }
  .cart-popup-item:nth-child(9) { animation-delay: 0.45s; }
  .cart-popup-item:nth-child(10) { animation-delay: 0.5s; }
  @keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .cart-popup-item:last-child {
    border-bottom: none;
  }
  .cart-popup-thumb-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
  }
  .cart-popup-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  /* Hover thumbnail tooltip */
  .popup-thumb-tooltip {
    position: fixed;
    z-index: 10001;
    width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s, transform 0.18s;
    border: 1px solid var(--gray-100);
  }
  .popup-thumb-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .popup-thumb-tooltip img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
  }
  .popup-thumb-tooltip-label {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
    font-family: 'Open Sans', sans-serif;
    text-align: center;
  }
  .cart-popup-item-info {
    flex: 1;
    min-width: 0;
  }
  .cart-popup-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cart-popup-item-spec {
    font-size: 12px;
    color: var(--gray-400);
    margin: 0;
  }
  .cart-popup-item-qty {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    flex-shrink: 0;
    text-align: right;
  }
  .cart-popup-item-subtotal {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    flex-shrink: 0;
    min-width: 70px;
    text-align: right;
  }
  .cart-popup-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--gray-400);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
  }
  .cart-popup-item-remove:hover {
    color: #DC2626;
    background: #FEF2F2;
  }
  .cart-popup-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--gray-100);
  }
  .cart-popup-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
  }
  .cart-popup-total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
  }
  .cart-popup-total-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--green-600);
  }
  .cart-popup-total-amount span {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 400;
    margin-left: 4px;
  }
  @keyframes waPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(37,211,102,0.3); }
    50% { box-shadow: 0 6px 24px rgba(37,211,102,0.5), 0 0 0 6px rgba(37,211,102,0.08); }
  }
  .btn-ready-to-pay {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(37,211,102,0.3);
    animation: waPulse 2.5s ease-in-out infinite;
    transition: background-color 0.35s ease, color 0.35s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  .btn-ready-to-pay svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
  }
  .btn-ready-to-pay:hover {
    background: linear-gradient(135deg, #20BD5A, #0F7A6E);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37,211,102,0.4);
    animation: none;
  }
  .cart-popup-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--gray-400);
    font-size: 14px;
  }

  /* ===== Cart View ===== */
  .shop-cart-view {
    display: none;
  }
  .shop-cart-view.active {
    display: block;
  }
  .shop-list-view.hidden {
    display: none;
  }
  .shop-cart-bar.hidden {
    display: none;
  }

  .cart-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
  }
  .btn-back {
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: 'Poppins', sans-serif;
    background: var(--green-600);
    color: #fff;
    transition: background 0.15s, color 0.15s;
  }
  .btn-back:hover {
    background: transparent;
    border: none;
    color: var(--green-600);
    box-shadow: inset 0 0 0 2px var(--green-600);
  }
  .btn-clear-cart {
    margin-left: auto;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
  }
  .btn-clear-cart:hover {
    background: #fef2f2;
  }
  .cart-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
  }

  .cart-table {
    width: 100%;
    border-collapse: collapse;
  }
  .cart-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-100);
  }
  .cart-table th:last-child,
  .cart-table th:nth-child(5),
  .cart-table th:nth-child(6) {
    text-align: right;
  }
  .cart-table td {
    padding: 16px;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-50);
    vertical-align: middle;
  }
  .cart-table td:last-child,
  .cart-table td:nth-child(5),
  .cart-table td:nth-child(6) {
    text-align: right;
  }
  .cart-prod {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .cart-prod-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .cart-prod-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .cart-prod-name {
    font-weight: 600;
    color: var(--gray-900);
  }
  .cart-qty-input {
    width: 60px;
    padding: 6px 4px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    box-sizing: border-box;
  }
  .cart-qty-input:focus {
    border-color: var(--green-600);
  }
  .btn-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: color 0.2s;
    font-family: 'Open Sans', sans-serif;
  }
  .btn-remove:hover {
    color: var(--red-500);
  }

  .cart-summary {
    margin-top: 20px;
    padding: 24px;
    background: var(--green-50);
    border: 1px solid var(--green-100);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cart-summary-row.divider {
    padding-top: 16px;
    border-top: 1px solid var(--green-100);
  }
  .cart-summary-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
  }
  .cart-summary-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--green-600);
  }
  .cart-summary-deposit {
    font-size: 22px;
    font-weight: 700;
    color: #0F172A;
  }
  .cart-summary-note {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
    line-height: 1.6;
  }
  .cart-logistics {
    margin-top: 16px;
    padding: 16px 20px;
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 10px;
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.7;
  }
  .cart-logistics strong {
    color: #C2410C;
  }

  .cart-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--gray-400);
  }
  .cart-empty p {
    font-size: 15px;
    margin: 0 0 16px;
  }

  /* ===== Order Form ===== */
  .order-section {
    margin-top: 32px;
    padding: 28px;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    background: #fff;
  }
  .order-section h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 6px;
  }
  .order-section .order-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0 0 24px;
  }
  .order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .order-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .order-field.full {
    grid-column: 1 / -1;
  }
  .order-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
  }
  .order-field label .required {
    color: var(--red-500);
  }
  .order-field input,
  .order-field textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
  }
  .order-field input:focus,
  .order-field textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px var(--green-50);
  }
  .order-field textarea {
    resize: vertical;
    min-height: 80px;
  }
  .order-hint {
    font-size: 12px;
    color: var(--red-500);
    margin: 8px 0 0;
  }
  .btn-submit {
    margin-top: 24px;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Open Sans', sans-serif;
    background: var(--green-600);
    color: #fff;
    transition: background 0.2s;
  }
  .btn-submit:hover {
    background: var(--green-700);
  }
  .btn-submit:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    color: var(--gray-500);
  }
  .order-footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 12px;
  }

  /* SD9: Toast — spring slide-in */
  .toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Open Sans', sans-serif;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .toast.success {
    background: var(--green-600);
    color: #fff;
  }
  .toast.error {
    background: var(--red-500);
    color: #fff;
  }

  .card-fab { display: none; }
  .qty-stepper { display: none; }

  @media (max-width: 768px) {
    .shop-item {
      flex-wrap: wrap;
      gap: 10px;
    }
    .shop-item.volume-item {
      border-left: 3px solid #EA580C;
    }
    .shop-item-info {
      order: 1;
      flex: 1 1 100%;
    }
    .shop-item-price {
      order: 2;
    }
    .shop-item-qty {
      order: 3;
    }
    .shop-item-add {
      order: 4;
    }
    .shop-cart-bar {
      flex-wrap: wrap;
      gap: 12px;
    }
    .shop-cart-bar .cart-total {
      flex: 1 1 100%;
    }
    .cart-table {
      font-size: 12px;
    }
    .cart-table th,
    .cart-table td {
      padding: 8px 6px;
    }
    .cart-table th:nth-child(2),
    .cart-table td:nth-child(2) {
      display: none;
    }
    .order-grid {
      grid-template-columns: 1fr;
    }
    .cart-summary {
      flex-direction: column;
      align-items: flex-start;
    }
  }

  /* ===== MOBILE ≤480px — Two-Layer Card Layout ===== */
  @media (max-width: 480px) {
    .shop-container { padding: 0 14px; }

    /* SM2: Safe area adaptation */
    .shop-toast, .toast { padding-top: env(safe-area-inset-top, 0px); }

    /* SM9: Mobile skeleton - 2 column */
    .skeleton-card .img-placeholder { height: 120px; }
    .skeleton-card .text-line { height: 12px; margin: 8px; }
    .skeleton-card .text-line.short { width: 60%; }

    .shop-header { padding: 24px 0 16px; }
    .shop-header h1 { font-size: 24px; }
    .shop-header p { font-size: 13px; }

    .shop-search { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--gray-100); }
    .shop-search input { max-width: 100%; min-height: 48px; }

    /* SM10: Categories — horizontal scroll with gap */
    .shop-categories {
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
      padding-top: 2px;
      padding-bottom: 4px;
      margin-bottom: 20px;
      gap: 8px;
      scroll-padding: 0 14px;
      position: relative;
    }
    /* P3-11: Gradient scroll hint at right edge */
    .shop-categories::after {
      content: '';
      position: sticky;
      right: 0;
      top: 0;
      bottom: 0;
      width: 32px;
      flex-shrink: 0;
      background: linear-gradient(90deg, transparent 0%, rgba(249,250,251,0.95) 100%);
      pointer-events: none;
      z-index: 2;
    }
    .shop-categories::-webkit-scrollbar { display: none; }
    .shop-cat { flex-shrink: 0; white-space: nowrap; font-size: 12px; min-height: 44px; padding: 0 14px; line-height: 44px; border-radius: 22px; }
    .shop-cat.active { box-shadow: 0 6px 16px rgba(21,128,61,0.18); }

    /* Product list gap */
    .shop-list { gap: 12px; }
    .shop-page.has-cart-items .shop-list { padding-bottom: 92px; }
    @supports (content-visibility: auto) {
      .shop-list .shop-item {
        content-visibility: auto;
        contain-intrinsic-size: 168px;
      }
    }

    /* ===== Two-Layer Card ===== */
    .shop-item {
      display: grid;
      grid-template-columns: 32px 1fr;
      grid-template-rows: auto auto;
      gap: 8px 8px;
      padding: 14px 14px 14px 10px;
      align-items: start;
      position: relative;
    }

    /* SM5: FAB button per card */
    .card-fab {
      position: absolute; bottom: 12px; right: 12px;
      width: 44px; height: 44px; border-radius: 50%;
      background: linear-gradient(135deg, var(--green-600), #1a9a4a);
      color: white; border: none; font-size: 24px;
      box-shadow: 0 4px 16px rgba(21,128,61,0.3);
      display: flex;
      align-items: center; justify-content: center;
      cursor: pointer; z-index: 5;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      font-family: 'Open Sans', sans-serif;
      line-height: 1;
      outline: none;
    }
    .card-fab.hidden-fab { display: none !important; }
    .qty-stepper.hidden-stepper { display: none !important; }
    .card-fab:active { transform: scale(0.9); }
    .card-fab:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
    .shop-item.volume-item {
      border-left: none;
      border-top: 3px solid #EA580C;
      background: linear-gradient(180deg, #FFF7ED 0%, #fff 20%, #fff 100%);
    }
    .shop-item.removing {
      border-left: none !important;
      border-top: 3px solid #EF4444 !important;
      background: linear-gradient(180deg, #FEF2F2 0%, #fff 30%, #fff 100%) !important;
    }

    /* Row 1: Thumb (col 1) + Info (col 2) */
    .shop-item-thumb {
      grid-column: 1; grid-row: 1;
      width: 32px; height: 32px;
      align-self: start;
      position: relative;
      overflow: hidden;
      border-radius: 6px;
    }
    .shop-item-info {
      grid-column: 2; grid-row: 1;
      flex: none; min-width: 0;
    }
    .shop-item-name {
      font-size: 14px;
      white-space: normal;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 100%;
      line-height: 1.28;
    }
    .shop-item-spec { font-size: 12px; }
    .shop-item-extra { font-size: 11px; }
    .shop-item-stock,
    .shop-item-badge {
      max-width: 100%;
      white-space: nowrap;
      vertical-align: middle;
      display: inline-flex;
      align-items: center;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.35;
    }
    .shop-item-stock { font-size: 10px; padding: 1px 7px; margin: 4px 4px 0 0; max-width: 58px; }
    .shop-item-badge { font-size: 9px; padding: 1px 6px; margin: 4px 0 0 0; max-width: 78px; }

    /* Row 2: Price (col 1) + Qty Actions (col 2) */
    .shop-item-price {
      grid-column: 1; grid-row: 2;
      text-align: left; min-width: 0;
      align-self: center;
    }
    .shop-item-price .price { font-size: 15px; }
    .shop-item-price .unit { display: block; font-size: 10px; margin-top: 1px; }

    .shop-item-qty-actions {
      grid-column: 2; grid-row: 2;
      justify-self: end; align-self: center;
      gap: 4px;
    }
    .btn-minus { min-width: 44px; min-height: 44px; font-size: 18px; border-radius: 20px; }
    .shop-item-qty { display: none; }
    .shop-item-qty .qty-label { font-size: 9px; margin-top: 2px; }
    .btn-add { min-height: 44px; padding: 7px 14px; font-size: 13px; border-radius: 6px; line-height: 1; display: flex; align-items: center; justify-content: center; }

    /* Mobile: only FAB (not in cart) or stepper (in cart) — hide redundant desktop buttons */
    .shop-item .btn-minus,
    .shop-item .shop-item-add {
      display: none;
    }

    .shop-item-qty input {
      height: 44px;
      padding: 0 6px;
      width: 56px;
      box-sizing: border-box;
      line-height: 44px;
    }

    /* SM4: Stepper */
    .qty-stepper {
      display: flex;
      align-items: center;
      gap: 0;
      justify-self: end;
      align-self: center;
    }
    .qty-btn {
      width: 36px; height: 36px;
      border-radius: 8px;
      border: 1px solid #e2e8f0;
      background: #fff;
      color: var(--gray-700);
      font-size: 18px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      font-family: 'Open Sans', sans-serif;
      transition: all 0.15s ease;
      line-height: 1;
      outline: none;
      -webkit-tap-highlight-color: transparent;
    }
    .qty-btn:focus, .qty-btn:focus-visible { outline: none; }
    .qty-btn:active { background: #f0fdf4; border-color: var(--green-600); transform: scale(0.9); }
    .qty-val {
      width: 32px;
      text-align: center;
      font-size: 15px;
      font-weight: 700;
      color: var(--gray-900);
      user-select: none;
    }

    /* ===== Cart Bar — single-row compact ===== */
    .shop-cart-bar {
      flex-direction: row;
      flex-wrap: nowrap;
      gap: 8px;
      padding: 10px 14px;
      bottom: max(10px, env(safe-area-inset-bottom, 10px));
      margin-top: 24px;
      border-radius: 12px;
      align-items: center;
    }
    .shop-cart-bar .cart-info { font-size: 12px; gap: 4px; flex-shrink: 0; }
    .shop-cart-bar .cart-count { width: 20px; height: 20px; font-size: 10px; border-radius: 10px; }
    .shop-cart-bar .cart-total { flex: 1; text-align: left; font-size: 13px; white-space: nowrap; }
    .shop-cart-bar .cart-total span { display: inline; margin-left: 4px; font-size: 11px; }
    .btn-view-cart { padding: 8px 16px; font-size: 12px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }

    /* ===== Cart Popup — bottom sheet ===== */
    .cart-popup {
      position: fixed; bottom: 0; left: 0; right: 0;
      width: 100%; max-width: 100vw;
      max-height: 70vh;
      border-radius: 20px 20px 0 0;
      transform: translateY(100%);
      transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
      z-index: 10000;
    }
    .cart-popup-overlay.visible .cart-popup {
      transform: translateY(0);
    }
    .cart-popup-overlay {
      align-items: flex-end;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
    }
    .bs-handle {
      width: 40px; height: 4px;
      background: #cbd5e1;
      border-radius: 2px;
      margin: 12px auto 8px;
      flex-shrink: 0;
    }
    .cart-popup-header { padding: 16px 18px 10px; }
    .cart-popup-header h3 { font-size: 16px; }
    .cart-popup-body { padding: 6px 18px; }
    .cart-popup-footer { padding: 12px 18px 18px; }
    .cart-popup-item { gap: 10px; padding: 10px 0; }
    .cart-popup-item-name { font-size: 13px; }
    .cart-popup-item-subtotal { font-size: 13px; min-width: 60px; }
    .cart-popup-total-amount { font-size: 16px; }

    /* ===== Cart View (checkout) ===== */
    .cart-header { margin-bottom: 16px; flex-wrap: wrap; }
    .cart-header h2 { font-size: 20px; }
    .btn-back { padding: 8px 16px; font-size: 13px; }
    .btn-clear-cart { margin-left: 0; padding: 8px 12px; font-size: 12px; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; box-sizing: border-box; }
    .cart-table thead { display: none; }
    .cart-table tr {
      margin-bottom: 12px;
      padding: 14px;
      border: 1px solid var(--gray-100);
      border-radius: 12px;
      background: #fff;
      box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    }
    .cart-table td {
      border-bottom: 0;
      padding: 8px 0;
      font-size: 13px;
      text-align: left !important;
    }
    .cart-table td[data-label] {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
    }
    .cart-table td[data-label]::before {
      content: attr(data-label);
      color: var(--gray-400);
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .cart-prod { gap: 10px; align-items: flex-start; }
    .cart-prod-thumb { width: 44px; height: 44px; }
    .cart-prod-name { font-size: 14px; line-height: 1.35; }
    .cart-spec-cell { color: var(--gray-500); line-height: 1.45; }
    .cart-subtotal-cell { color: var(--green-700); font-size: 16px !important; }
    .cart-qty-input { width: 76px; min-height: 40px; padding: 6px 8px; font-size: 15px; }
    .cart-remove-cell { padding-top: 4px !important; }
    .btn-remove {
      width: 100%;
      min-height: 40px;
      border-radius: 8px;
      background: #fff7ed;
      color: #c2410c;
      font-size: 20px;
    }
    .order-section { padding: 18px 14px; border-radius: 10px; }
    .order-section h3 { font-size: 18px; }
    .order-grid { gap: 12px; }
    .order-field input, .order-field textarea { padding: 10px 12px; font-size: 13px; }
    .cart-summary { padding: 16px; gap: 12px; }
    .cart-summary-total { font-size: 16px; }
    .cart-summary-deposit { font-size: 18px; }
    .cart-logistics { padding: 12px 14px; font-size: 12px; }
    .cart-empty { padding: 40px 20px; }
    .cart-empty p { font-size: 14px; }

    /* ===== Footer ===== */
    .shop-footer { padding: 18px 0; margin-top: 24px; }

    /* ===== Tooltip — disable on touch ===== */
    .cat-tooltip { display: none !important; }
    .popup-thumb-tooltip { display: none !important; }

    /* ===== Product Lightbox — mobile fullscreen overlay ===== */
    .prod-lightbox-overlay {
      align-items: stretch;
      background: rgba(15, 23, 42, 0.55);
    }
    .prod-lightbox-overlay .prod-lightbox {
      background: #fff;  /* card stays white */
    }
    .prod-lightbox-overlay .prod-lightbox {
      width: 100%; max-width: 100%;
      height: 90%; max-height: 90vh;
      border-radius: 20px 20px 0 0;
      bottom: 0; left: 0; right: 0; top: auto;
      transform: translateY(100%);
      display: flex;
      flex-direction: column;
      box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
      overflow: hidden;
      box-sizing: border-box;
    }
    .prod-lightbox-overlay.visible .prod-lightbox {
      transform: translateY(0);
    }
    .prod-lightbox-close {
      position: absolute; top: 16px; left: 16px; z-index: 20;
      width: 44px; height: 44px;
      border-radius: 50%;
      background: rgba(255,255,255,0.9);
      color: #0F172A;
      border: none;
      font-size: 22px; font-weight: 400;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      font-family: 'Open Sans', sans-serif;
      box-shadow: 0 2px 12px rgba(0,0,0,0.15);
      animation: btnPulse 3s ease-in-out infinite;
      transition: background 0.4s, color 0.4s;
    }
    .prod-lightbox-close:hover {
      background: #15803D;
      color: #fff;
      box-shadow: 0 4px 20px rgba(21,128,61,0.35);
    }
    @keyframes btnPulse {
      0%, 100% { background: rgba(255,255,255,0.9); }
      50% { background: #15803D; color: #fff; }
    }
    .prod-lightbox-gallery {
      position: relative;
      width: 100%; max-width: 100vw; height: 55vh;
      background: #0F172A;
      overflow: hidden;
      flex-shrink: 0;
      touch-action: pan-x pinch-zoom;
      box-sizing: border-box;
    }
    .prod-lightbox-gallery-inner {
      display: flex;
      height: 100%;
      transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
      will-change: transform;
    }
    .prod-lightbox-gallery-inner.swiping {
      transition: none;
    }
    .prod-lightbox-slide {
      flex: 0 0 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }
    .prod-lightbox-slide img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      -webkit-user-drag: none;
      user-select: none;
    }
    .prod-lightbox-dots {
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 8px;
      z-index: 10;
    }
    .prod-lightbox-dot {
      width: 24px; height: 24px;
      border-radius: 50%;
      background: rgba(255,255,255,0.15);
      border: none;
      padding: 0;
      cursor: pointer;
      transition: background 0.2s, transform 0.2s;
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .prod-lightbox-dot::after {
      content: '';
      width: 8px; height: 8px;
      border-radius: 50%;
      background: rgba(255,255,255,0.5);
    }
    .prod-lightbox-dot.active {
      background: var(--green-600);
      transform: scale(1.3);
      box-shadow: 0 0 6px rgba(21,128,61,0.6);
    }
    .prod-lightbox-dot.active::after {
      background: #fff;
    }
    .prod-lightbox-info {
      flex: 1;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 20px 18px 32px;
      background: #fff;
    }
    .prod-lightbox-info .plb-name {
      font-family: 'Poppins', sans-serif;
      font-size: 20px;
      font-weight: 700;
      color: var(--gray-900);
      margin: 0 0 4px;
    }
    .prod-lightbox-info .plb-cat {
      font-size: 12px;
      color: var(--green-600);
      font-weight: 600;
      margin: 0 0 16px;
      display: inline-block;
      background: var(--green-50);
      padding: 3px 10px;
      border-radius: 12px;
    }
    .prod-lightbox-info .plb-price {
      font-size: 26px;
      font-weight: 700;
      color: var(--gray-900);
      margin: 0 0 2px;
    }
    .prod-lightbox-info .plb-unit {
      font-size: 13px;
      color: var(--gray-400);
      margin: 0 0 8px;
    }
    .prod-lightbox-info .plb-minqty {
      display: inline-block;
      padding: 4px 10px;
      background: #FFF7ED;
      color: #C2410C;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 600;
      margin-bottom: 16px;
    }
    .prod-lightbox-details {
      border-top: 1px solid var(--gray-100);
      padding-top: 14px;
      margin-bottom: 16px;
    }
    .prod-lightbox-details h4 {
      font-family: 'Poppins', sans-serif;
      font-size: 14px;
      font-weight: 700;
      color: var(--gray-700);
      margin: 0 0 10px;
    }
    .prod-lightbox-detail-row {
      display: flex;
      justify-content: space-between;
      padding: 7px 0;
      border-bottom: 1px solid var(--gray-50);
      font-size: 13px;
    }
    .prod-lightbox-detail-row .dt-label {
      color: var(--gray-500);
      font-weight: 500;
    }
    .prod-lightbox-detail-row .dt-value {
      color: var(--gray-900);
      font-weight: 600;
      text-align: right;
      max-width: 60%;
    }
    .prod-lightbox-actions {
      display: flex;
      gap: 10px;
    }
    .btn-lb-add {
      flex: 1;
      padding: 14px;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      border: none;
      font-family: 'Poppins', sans-serif;
      background: var(--green-600);
      color: #fff;
      transition: background 0.2s;
    }
    .btn-lb-add:hover { background: var(--green-700); }
    .btn-lb-wa {
      padding: 14px 18px;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 700;
      cursor: pointer;
      border: 1px solid #25D366;
      background: #fff;
      color: #25D366;
      font-family: 'Poppins', sans-serif;
      transition: background 0.2s;
      display: flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
    }
    .btn-lb-wa:hover { background: #F0FFF4; }

    /* SM8: WhatsApp floating button */
    @keyframes waFloatPulse {
      0%,100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
      50% { box-shadow: 0 6px 28px rgba(37,211,102,0.6), 0 0 0 8px rgba(37,211,102,0.1); }
    }
    .wa-float {
      position: fixed; bottom: 24px; right: 20px; z-index: 9998;
      width: 56px; height: 56px; border-radius: 50%;
      background: #25D366; color: white;
      box-shadow: 0 4px 20px rgba(37,211,102,0.4);
      display: flex; align-items: center; justify-content: center;
      font-size: 28px;
      text-decoration: none;
      animation: waFloatPulse 2s ease-in-out infinite;
    }

    /* Mobile: arrows always visible */
    .prod-lightbox-prev,
    .prod-lightbox-next {
      opacity: 0.8;
      width: 40px; height: 40px;
    }

    /* P2-8: Keep all products interactive after cart has items */
  .shop-page.has-cart-items .shop-item.in-cart-active {
      border: 1px solid rgba(21,128,61,0.18);
      box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(21,128,61,0.14);
    }
    .shop-page.has-cart-items ~ #cro-floating-bar {
      display: none !important;
    }
  }

  /* Desktop shop rows: keep price, quantity, and Add controls on one visual rail. */
  @media (min-width: 769px) {
    .shop-item {
      min-height: 112px;
    }

    .shop-item-price {
      min-width: 108px;
      align-self: center;
    }

    .shop-item-qty-actions {
      align-items: center;
      gap: 8px;
      min-height: 48px;
    }

    .shop-item-qty input {
      width: 76px;
      height: 48px;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 600;
    }

    .shop-item-qty .qty-label {
      display: none;
    }

    .btn-minus,
    .btn-add {
      height: 48px;
      min-height: 48px;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
    }

    .btn-minus {
      min-width: 48px;
      width: 48px;
      border-radius: 50%;
    }

    .btn-add {
      width: 100px;
      padding: 0 22px;
      font-size: 14px;
    }
  }

  /* ===== Foldable / Tablet (481–960px) ===== */
  @media (min-width: 481px) and (max-width: 960px) {
    .shop-container { padding: 0 20px; }
    .shop-header h1 { font-size: 28px; }
    .shop-header p { font-size: 14px; }
    .shop-item {
      padding: 14px 18px;
      gap: 14px;
    }
    .shop-item-name { font-size: 15px; }
    .shop-item-spec { font-size: 13px; }
    .shop-item-price .price { font-size: 18px; }
    .cat-filters { gap: 5px; }
    .cat-pill { font-size: 12px; padding: 6px 12px; }
    .shop-item-qty-actions { gap: 8px; }
    .qty-input { width: 60px; }
  }

/* ===== PRODUCT LIGHTBOX CSS ===== */
.prod-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .prod-lightbox-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .prod-lightbox {
    background: #fff;
    border-radius: 18px;
    width: 860px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    box-shadow: 0 24px 72px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.06);
    transform: translateY(12px);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
  }
  .prod-lightbox-overlay.visible .prod-lightbox {
    transform: translateY(0);
  }
  .prod-lightbox-close {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #0F172A;
    border: none;
    font-size: 22px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: 'Open Sans', sans-serif;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    animation: btnPulse 3s ease-in-out infinite;
    transition: background 0.4s, color 0.4s;
    bottom: auto;
    right: auto;
  }
  .prod-lightbox-close:hover {
    background: #15803D;
    color: #fff;
    box-shadow: 0 4px 20px rgba(21,128,61,0.35);
  }
  @keyframes btnPulse {
    0%, 100% { background: rgba(255,255,255,0.9); color: #0F172A; }
    50% { background: #15803D; color: #fff; }
  }

  /* Gallery panel (left) */
  .prod-lightbox-gallery {
    position: relative;
    width: 420px;
    min-height: 420px;
    background: #0F172A;
    flex-shrink: 0;
    overflow: hidden;
  }
  .prod-lightbox-gallery-inner {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
  }
  .prod-lightbox-gallery-inner.swiping {
    transition: none;
  }
  .prod-lightbox-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .prod-lightbox-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
  }

  /* Dots */
  .prod-lightbox-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
  }
  .prod-lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
  }
  .prod-lightbox-dot.active {
    background: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
  }

  /* Nav arrows — hidden on desktop, visible on hover */
  .prod-lightbox-prev,
  .prod-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0F172A;
    font-weight: 700;
    transition: background 0.2s, opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    font-family: 'Open Sans', sans-serif;
    line-height: 1;
  }
  @media (min-width: 481px) {
    .prod-lightbox-prev,
    .prod-lightbox-next {
      opacity: 0;
    }
  }
  .prod-lightbox-prev { left: 10px; }
  .prod-lightbox-next { right: 10px; }
  @media (min-width: 481px) {
    .prod-lightbox-gallery:hover .prod-lightbox-prev,
    .prod-lightbox-gallery:hover .prod-lightbox-next {
      opacity: 1;
    }
  }
  .prod-lightbox-prev:hover,
  .prod-lightbox-next:hover {
    background: #fff;
  }

  /* Info panel (right) */
  .prod-lightbox-info {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
  }
  .prod-lightbox-info::-webkit-scrollbar {
    width: 4px;
  }
  .prod-lightbox-info::-webkit-scrollbar-thumb {
    background: var(--gray-200);
    border-radius: 2px;
  }
  .plb-name {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 4px;
    padding-right: 30px;
  }
  .plb-cat {
    font-size: 12px;
    color: var(--green-600);
    font-weight: 600;
    margin: 0 0 20px;
    display: inline-block;
    background: var(--green-50);
    padding: 3px 10px;
    border-radius: 12px;
  }
  .plb-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
  }
  .plb-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
  }
  .plb-unit {
    font-size: 14px;
    color: var(--gray-400);
  }
  .plb-minqty {
    display: inline-block;
    padding: 4px 10px;
    background: #FFF7ED;
    color: #C2410C;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin: 8px 0 20px;
  }

  /* Details table */
  .prod-lightbox-details {
    border-top: 1px solid var(--gray-100);
    padding-top: 16px;
    margin-bottom: 16px;
  }
  .prod-lightbox-details h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .prod-lightbox-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-50);
    font-size: 13px;
  }
  .prod-lightbox-detail-row .dt-label {
    color: var(--gray-500);
    font-weight: 500;
  }
  .prod-lightbox-detail-row .dt-value {
    color: var(--gray-900);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
  }

  /* Action buttons */
  .prod-lightbox-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
    padding-top: 20px;
  }
  .btn-lb-add {
    flex: 1;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-family: 'Poppins', sans-serif;
    background: var(--green-600);
    color: #fff;
    transition: background 0.2s;
  }
  .btn-lb-add:hover { background: var(--green-700); }
  .btn-lb-add.in-cart {
    background: var(--gray-100);
    color: var(--gray-500);
  }
  .btn-lb-wa {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #25D366;
    background: #fff;
    color: #25D366;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }
  .btn-lb-wa:hover { background: #F0FFF4; }
/* ══════════════════════════════════════════════════════════════
   SHOP UI ENHANCEMENTS — Desktop (SD1–SD12) + Mobile (SM1–SM12)
   ══════════════════════════════════════════════════════════════ */

/* SD1: Search bar with icon + pill shape */
.shop-search { position: relative; }
.shop-search::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
  z-index: 2;
}
.shop-search input {
  padding-left: 42px;
  border-radius: 24px;
  background: #F8FAFC;
  border-color: #E2E8F0;
  transition: all 0.25s ease;
}
.shop-search input:focus {
  background: #fff;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(21,128,61,0.1), 0 4px 12px rgba(21,128,61,0.06);
}

/* SD2: Category tabs — count badge + active animation */
.cat-tab {
  position: relative;
  padding: 7px 16px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  transition: all 0.25s ease;
  font-family: 'Open Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-tab:hover {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--green-700);
}
.cat-tab.active {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(21,128,61,0.25);
  transform: translateY(-1px);
}

/* SD3: Staggered card entrance animation */
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.shop-item { animation: cardSlideUp 0.5s cubic-bezier(0.22,1,0.36,1) both; }
.shop-item:nth-child(1) { animation-delay: 0.03s; }
.shop-item:nth-child(2) { animation-delay: 0.06s; }
.shop-item:nth-child(3) { animation-delay: 0.09s; }
.shop-item:nth-child(4) { animation-delay: 0.12s; }
.shop-item:nth-child(5) { animation-delay: 0.15s; }
.shop-item:nth-child(6) { animation-delay: 0.18s; }
.shop-item:nth-child(7) { animation-delay: 0.21s; }
.shop-item:nth-child(8) { animation-delay: 0.24s; }

/* SD4: Product thumb size refinement — desktop only (mobile/tablet handled in their own @media blocks) */
@media (min-width: 961px) {
  .shop-item-thumb { width: 64px; height: 64px; border-radius: 10px; }
}

/* SD5: Promo badge — animated gradient shimmer */
@keyframes promoShimmer {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.shop-item-badge {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5, #FFF7ED);
  background-size: 200% auto;
  animation: promoShimmer 3s ease-in-out infinite;
}

/* SD6: Cart bar — smooth pulse when items change */
@keyframes barGlow {
  0%,100% { box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
  50% { box-shadow: 0 8px 40px rgba(21,128,61,0.25), 0 0 0 2px rgba(21,128,61,0.1); }
}
.shop-cart-bar.has-items { animation: barGlow 2.5s ease-in-out infinite; }
.shop-cart-bar .cart-total { font-family: 'Poppins',sans-serif; }

/* SD7: Quantity stepper button refinement */
.btn-minus:active, .qty-btn:active { transform: scale(0.9); }

/* SD8: Toast — slide down + brand color */
.toast {
  background: linear-gradient(135deg, var(--green-600), #1a9a4a);
  color: #fff;
  box-shadow: 0 8px 28px rgba(21,128,61,0.3);
  top: 20px;
  border-radius: 12px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.show { animation: toastIn 0.35s cubic-bezier(0.22,1,0.36,1); }

/* SD9: Cart popup smooth scroll */
.cart-popup-body { scroll-behavior: smooth; }

/* SD10: Lightbox info panel scrollbar */
.prod-lightbox-info::-webkit-scrollbar { width: 4px; }
.prod-lightbox-info::-webkit-scrollbar-track { background: transparent; }
.prod-lightbox-info::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* SD11: Unified button hover lift */
.btn-add, .btn-view-cart, .btn-ready-to-pay, .btn-lb-add {
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
}
.btn-add:hover, .btn-view-cart:hover, .btn-lb-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(21,128,61,0.25);
}

/* SD12: Skeleton loading refinement — core rules now in SD5 above */

/* ═══════════════════════════════════════════════════
   MOBILE ENHANCEMENTS (SM1–SM12) ≤480px
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* SM1: Search — full width + icon adjustment */
  .shop-search input { padding-left: 40px; border-radius: 20px; font-size: 15px; }

  /* SM2: Category tabs — snap scroll + count badges inline */
  .shop-categories {
    scroll-snap-type: x mandatory;
    gap: 6px;
    padding-bottom: 12px;
  }
  .cat-tab {
    scroll-snap-align: start;
    font-size: 11px;
    padding: 0 14px;
    min-height: 44px;
    line-height: 44px;
    border-radius: 22px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* SM3: Card touch feedback — press scale */
  .shop-item:active { transform: scale(0.98); }
  .shop-item:hover { transform: none; box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 8px rgba(21,128,61,0.04), 0 6px 20px rgba(15,23,42,0.06); }

  /* SM4: FAB button — bigger touch target + vibration hint */
  .card-fab {
    width: 52px; height: 52px;
    bottom: 14px; right: 14px;
    font-size: 26px;
    box-shadow: 0 4px 20px rgba(21,128,61,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .card-fab:active { transform: scale(0.85); box-shadow: 0 2px 8px rgba(21,128,61,0.2); }

  /* SM5: Stepper buttons — bigger touch area */
  .qty-stepper { gap: 2px; }
  .qty-btn { width: 48px; height: 48px; font-size: 22px; }
  .qty-val { min-width: 32px; font-size: 17px; }

  /* SM6: Cart bar — safe area bottom + compact */
  .shop-cart-bar {
    padding-bottom: 12px;
    border-radius: 16px;
    margin-bottom: 0;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    left: 12px;
    right: 12px;
    z-index: 1200;
    box-sizing: border-box;
    max-width: calc(100% - 24px);
  }
  .shop-cart-bar .cart-total {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .shop-cart-bar .cart-total span { display: none; }

  .prod-lightbox,
  .prod-lightbox-gallery,
  .prod-lightbox-gallery-inner {
    max-width: 100vw;
  }

  /* SM7: Cart popup drag handle visual */
  .bs-handle {
    width: 48px; height: 5px;
    background: #cbd5e1;
    border-radius: 3px;
    margin: 14px auto 10px;
  }

  /* SM8: WhatsApp float — adjust position for cart bar */
  .wa-float {
    bottom: max(90px, calc(env(safe-area-inset-bottom, 20px) + 80px));
    right: 16px;
    width: 52px; height: 52px;
  }

  /* SM9: Cart view — mobile cards instead of a squeezed table */
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  .cart-table thead { display: none; }
  .cart-table tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--gray-100);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  }
  .cart-table td {
    border-bottom: 0;
    padding: 8px 0;
    font-size: 13px;
    text-align: left !important;
  }
  .cart-table td[data-label] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .cart-table td[data-label]::before {
    content: attr(data-label);
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .cart-prod { align-items: flex-start; gap: 10px; }
  .cart-prod-thumb { width: 44px; height: 44px; }
  .cart-prod-name { font-size: 14px; line-height: 1.35; }
  .cart-spec-cell { color: var(--gray-500); line-height: 1.45; }
  .cart-subtotal-cell { color: var(--green-700); font-size: 16px !important; }
  .cart-qty-input { width: 76px; min-height: 40px; padding: 6px 8px; font-size: 15px; }
  .cart-remove-cell { padding-top: 4px !important; }
  .btn-remove {
    width: 100%;
    min-height: 40px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 20px;
  }
  .btn-clear-cart { margin-left: 0; padding: 8px 12px; font-size: 12px; }

  /* SM10: Empty cart — cozy spacing */
  .cart-empty { padding: 48px 20px; }
  .cart-empty p { font-size: 15px; }

  /* SM11: Lightbox gallery — pull-down hint */
  .prod-lightbox-gallery::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    z-index: 15;
  }

  /* SM12: Toast — top safe area + centered */
  .toast {
    top: max(20px, env(safe-area-inset-top, 20px));
    left: 16px; right: 16px;
    transform: none;
    width: auto;
    text-align: center;
  }
  @keyframes toastInMobile {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .toast.show { animation: toastInMobile 0.35s cubic-bezier(0.22,1,0.36,1); }
}

/* Tablet (481–960px) */
@media (min-width: 481px) and (max-width: 960px) {
  .shop-search input { padding-left: 42px; }
  .shop-item-thumb { width: 56px; height: 56px; }
  .cat-tab { padding: 7px 14px; }
}

/* Mobile tap-target hardening: keep the visible cart controls as real buttons. */
@media (max-width: 480px) {
  .shop-item .card-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-sizing: border-box;
    line-height: 1;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .shop-item .card-fab.hidden-fab {
    display: none !important;
    pointer-events: none;
  }

  .shop-item .shop-item-add {
    display: none !important;
  }

  .shop-cart-bar:not(.hidden) {
    display: flex;
    min-height: 64px;
    pointer-events: auto;
  }

  .shop-cart-bar:not(.hidden) .btn-view-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    min-height: 44px;
    padding: 0 16px;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .toast {
    top: max(84px, calc(env(safe-area-inset-top, 0px) + 72px));
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
    padding: 12px 14px;
    line-height: 1.35;
    box-sizing: border-box;
  }

  .toast.show {
    transform: none;
  }

  .cart-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "back clear"
      "title title";
    align-items: center;
    gap: 10px 8px;
    margin-bottom: 18px;
  }

  .cart-header .btn-back {
    grid-area: back;
    justify-self: start;
    min-height: 42px;
    max-width: 100%;
    padding: 0 14px;
    white-space: normal;
    text-align: left;
    line-height: 1.2;
  }

  .cart-header .btn-clear-cart {
    grid-area: clear;
    justify-self: end;
    min-height: 42px;
    margin-left: 0;
  }

  .cart-header h2 {
    grid-area: title;
    width: 100%;
    font-size: 22px;
    line-height: 1.15;
    padding-top: 2px;
  }
}

@media (max-width: 360px) {
  .cart-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "back"
      "title"
      "clear";
  }

  .cart-header .btn-clear-cart {
    justify-self: start;
  }
}

/* Mobile shop polish: compact scan cards + stable iOS bottom cart. */
@media (max-width: 480px) {
  .shop-list {
    gap: 10px;
  }

  .shop-page.has-cart-items .shop-list {
    padding-bottom: 108px;
  }

  @supports (content-visibility: auto) {
    .shop-list .shop-item {
      contain-intrinsic-size: 120px;
    }
  }

  .shop-item {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    grid-template-rows: auto auto;
    gap: 7px 10px;
    min-height: 112px;
    padding: 12px;
    align-items: start;
  }

  .shop-item-thumb {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 56px;
    height: 56px;
    border-radius: 10px;
  }

  .shop-item-info {
    grid-column: 2 / 4;
    grid-row: 1;
    padding-right: 60px;
  }

  .shop-item-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.25;
  }

  .shop-item-spec {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .shop-item-extra {
    display: none;
  }

  .shop-item-stock,
  .shop-item-badge {
    margin-top: 3px;
    vertical-align: baseline;
  }

  .shop-item-price {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    padding-right: 4px;
  }

  .shop-item-price .price {
    font-size: 17px;
    line-height: 1.1;
  }

  .shop-item-price .unit {
    max-width: 124px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .shop-item-qty-actions {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    align-self: end;
  }

  .shop-item .card-fab {
    right: 12px;
    bottom: 12px;
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    font-size: 24px;
  }

  .shop-cart-bar:not(.hidden) {
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom, 8px));
    max-width: calc(100% - 20px);
    min-height: 68px;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom, 10px));
    gap: 8px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  }

  .shop-cart-bar .cart-info {
    min-width: 56px;
    gap: 5px;
  }

  .shop-cart-bar .cart-total {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
  }

  .shop-cart-bar:not(.hidden) .btn-view-cart {
    min-width: 104px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }
}
