
    #digitalUpsellModal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      z-index: 1000010;
      justify-content: center;
      align-items: center;
      padding: 10px;
      overflow-y: auto;
      overflow-x: hidden;
      pointer-events: auto;
    }
    
    /* Ensure floating cart stays above modal */
    #digitalUpsellModal ~ .floating-cart {
      z-index: 1000003 !important;
      pointer-events: auto !important;
    }
  
    #digitalUpsellModalContent {
      background: #ffffff;
      padding: 12px 12px 10px;
      border-radius: 12px;
      max-width: min(640px, 100vw - 20px);
      width: 100%;
      height: min(96vh, 950px);
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
      text-align: center;
      color: #2c3e50;
      position: relative;
      margin: auto;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    #digitalUpsellModalContent::-webkit-scrollbar {
      width: 8px;
    }

    #digitalUpsellModalContent::-webkit-scrollbar-track {
      background: #f1f3f5;
      border-radius: 4px;
    }

    #digitalUpsellModalContent::-webkit-scrollbar-thumb {
      background: #cbd5e0;
      border-radius: 4px;
    }

    #digitalUpsellModalContent::-webkit-scrollbar-thumb:hover {
      background: #a0aec0;
    }

    #digitalUpsellModal .upsell-close {
      position: absolute;
      top: 8px;
      right: 8px;
      background: #f5f5f5;
      border: none;
      border-radius: 50%;
      width: 28px;
      height: 28px;
      font-size: 18px;
      cursor: pointer;
      color: #666;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      z-index: 10;
    }

    #digitalUpsellModal .upsell-close:hover {
      background: #e0e0e0;
      color: #333;
    }
  
    #digitalUpsellModalContent h3 {
      font-size: 1.6rem;
      margin: 0 0 0.5rem 0;
      font-weight: 600;
      color: #1a1a1a;
      padding-right: 30px;
      letter-spacing: -0.5px;
    }

    #digitalUpsellModalContent .upsell-subtitle {
      display: none;
    }

    #digitalUpsellModalContent .upsell-price-highlight {
      display: none !important;
    }

    #digitalUpsellModalContent .upsell-price-highlight .original-price {
      text-decoration: line-through;
      font-weight: 500;
    }

    /* Compact header */
    .upsell-compact-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 0 0 8px;
      flex-shrink: 0;
    }
    .upsell-compact-header .upsell-header-left {
      text-align: left;
    }
    .upsell-compact-header .upsell-header-left h3 {
      font-size: 1.1rem !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    .upsell-compact-header .upsell-header-left .upsell-header-sub {
      font-size: 11.5px;
      color: #6b7280;
      margin-top: 2px;
    }
    .upsell-compact-price-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      border-radius: 8px;
      padding: 5px 10px;
      flex-shrink: 0;
    }
    .upsell-compact-price-pill .ucp-old {
      font-size: 12px;
      color: #9ca3af;
      text-decoration: line-through;
    }
    .upsell-compact-price-pill .ucp-new {
      font-size: 16px;
      font-weight: 800;
      color: #16a34a;
    }
    .upsell-compact-price-pill .ucp-label {
      font-size: 10px;
      color: #15803d;
      font-weight: 600;
    }

    /* Fixed header elements that should not shrink */
    #digitalUpsellModalContent > .upsell-close,
    #digitalUpsellModalContent > .upsell-compact-header,
    #digitalUpsellModalContent > div:first-of-type,
    #digitalUpsellModalContent > .upsell-subtitle,
    #digitalUpsellModalContent > .upsell-price-highlight {
      flex-shrink: 0;
    }

    /* Grid wrapper takes remaining space and allows internal scrolling */
    #digitalUpsellModalContent .upsell-grid-wrapper {
      flex: 1 1 0;
      min-height: 0;
      position: relative;
      overflow: hidden;
    }

    /* Fixed bottom elements — always visible below the grid */
    #digitalUpsellModalContent #upsellLoadingIndicator,
    #digitalUpsellModalContent .upsell-bottom-bar {
      flex-shrink: 0;
    }

    #digitalUpsellModalContent .upsell-artworks-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin: 0;
      height: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 8px;
      background: #f8f9fa;
      border-radius: 8px;
    }
    @media (min-width: 480px) {
      #digitalUpsellModalContent .upsell-artworks-grid {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    /* ALL horizontal artworks in upsell modal display in their actual ratio, 1 column each on desktop (3 col grid) */
    #digitalUpsellModalContent .upsell-artwork-item.horizontal-artwork {
      grid-column: span 1; /* Each artwork takes 1 column, 3 per row */
      border-radius: 8px;
      flex: 1 1 auto;
      position: relative;
      scrollbar-width: thin;
      scrollbar-color: #cbd5e0 #f1f3f5;
    }

    /* All artworks show their actual ratio in upsell modal */
    #digitalUpsellModalContent .upsell-artwork-item {
      grid-column: span 1;
      aspect-ratio: auto; /* Let images determine their own ratio */
    }

    #digitalUpsellModalContent .upsell-artwork-item img {
      height: auto; /* Height adjusts to maintain actual image ratio */
    }

    #digitalUpsellModalContent .upsell-artworks-grid::-webkit-scrollbar {
      width: 8px;
    }

    #digitalUpsellModalContent .upsell-artworks-grid::-webkit-scrollbar-track {
      background: #f1f3f5;
      border-radius: 4px;
    }

    #digitalUpsellModalContent .upsell-artworks-grid::-webkit-scrollbar-thumb {
      background: #cbd5e0;
      border-radius: 4px;
    }

    #digitalUpsellModalContent .upsell-artworks-grid::-webkit-scrollbar-thumb:hover {
      background: #a0aec0;
    }

    #digitalUpsellModalContent .scroll-indicator {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 40px;
      background: linear-gradient(to top, #f8f9fa, transparent);
      pointer-events: none;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      padding-bottom: 8px;
      transition: opacity 0.3s ease;
      z-index: 10;
    }

    #digitalUpsellModalContent .scroll-indicator.hidden {
      opacity: 0;
    }

    #digitalUpsellModalContent .scroll-indicator-arrow {
      color: #718096;
      font-size: 0.9rem;
      font-weight: 500;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    #digitalUpsellModalContent .upsell-artwork-item {
      position: relative;
      cursor: pointer;
      border-radius: 8px;
      transition: all 0.2s ease;
      border: 2px solid #e2e8f0;
      background: #ffffff;
    }

    #digitalUpsellModalContent .upsell-artwork-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      border-color: #cbd5e0;
    }

    #digitalUpsellModalContent .upsell-artwork-item.selected {
      border-color: #48bb78;
      box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.2);
    }

    #digitalUpsellModalContent .upsell-artwork-item .upsell-image-wrapper {
      width: 100%;
      position: relative;
      display: block;
      background: #1a1a1a;
      line-height: 0;
      overflow: hidden;
      border-radius: 8px;
    }

    #digitalUpsellModalContent .upsell-artwork-item img {
      width: 100%;
      height: auto;
      display: block;
      position: relative;
      z-index: 1;
      min-height: 150px;
      object-fit: contain;
      background: #f0f0f0;
      transition: opacity 0.3s ease;
    }

    /* Skeleton shimmer for images not yet loaded */
    #digitalUpsellModalContent .upsell-artwork-item img[data-src] {
      background: linear-gradient(110deg, #f0f0f0 30%, #e0e0e0 50%, #f0f0f0 70%);
      background-size: 200% 100%;
      animation: upsellShimmer 1.5s ease-in-out infinite;
    }

    @keyframes upsellShimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    #digitalUpsellModalContent .upsell-watermark-pattern {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      pointer-events: none;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: repeat(3, 1fr);
      gap: 0;
      overflow: hidden;
      padding: 10px;
      z-index: 2;
    }

    #digitalUpsellModalContent .upsell-watermark {
      font-size: 0.65rem;
      font-weight: bold;
      color: rgba(255, 255, 255, 0.35);
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
      pointer-events: none;
      white-space: nowrap;
      letter-spacing: 1px;
      display: flex;
      align-items: center;
      justify-content: center;
      transform: rotate(-25deg);
      text-align: center;
    }

    #digitalUpsellModalContent .upsell-artwork-checkbox {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 26px;
      height: 26px;
      background: white;
      border: 2px solid #48bb78;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: #48bb78;
      opacity: 0;
      transition: all 0.2s ease;
      z-index: 2;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    #digitalUpsellModalContent .upsell-artwork-item.selected .upsell-artwork-checkbox {
      opacity: 1;
      background: #48bb78;
      color: white;
    }

    #digitalUpsellModalContent .upsell-artwork-item:hover .upsell-artwork-checkbox {
      opacity: 0.6;
    }
  
    .upsell-bottom-bar {
      display: flex;
      gap: 8px;
      padding: 8px 0 max(4px, env(safe-area-inset-bottom, 4px));
      flex-shrink: 0;
    }

    .upsell-bottom-bar button {
      border: none;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
      padding: 12px 14px;
      white-space: nowrap;
    }
  
    #addUpsellArtworksAndCheckout {
      flex: 1;
      background: #16a34a;
      color: white;
    }

    #addUpsellArtworksAndCheckout:hover:not(:disabled) {
      background: #15803d;
    }

    #addUpsellArtworksAndCheckout:disabled {
      background: #e5e7eb;
      color: #9ca3af;
      cursor: not-allowed;
    }
  
    #continueWithoutUpsell {
      background: #f3f4f6;
      color: #374151;
      border: none;
    }

    #continueWithoutUpsell:hover {
      background: #e5e7eb;
    }

    @media (max-width: 1024px) {
      #digitalUpsellModal {
        padding: 0;
        align-items: stretch;
      }

      #digitalUpsellModalContent {
        padding: 10px 10px 8px;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
      }

      #digitalUpsellModalContent .upsell-bottom-bar {
        padding: 6px 0 max(4px, env(safe-area-inset-bottom, 4px));
      }

      #digitalUpsellModalContent h3 {
        font-size: 1.35rem;
        margin-bottom: 0.5rem;
      }

      #digitalUpsellModalContent .upsell-subtitle {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
      }

      #digitalUpsellModalContent .upsell-price-highlight {
        padding: 1rem 1.25rem;
        margin-bottom: 0.75rem;
      }

      #digitalUpsellModalContent .upsell-price-highlight .original-price {
        font-size: 1.1rem !important;
      }

      #digitalUpsellModalContent .upsell-price-highlight .sale-price {
        font-size: 1.5rem !important;
      }

      #digitalUpsellModalContent .upsell-grid-wrapper {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
      }

      #digitalUpsellModalContent .upsell-artworks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        height: 100%;
        padding: 8px;
        margin: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      /* TABLET: 2 columns in upsell modal, all artworks display in actual ratio, 1 column each */
      #digitalUpsellModalContent .upsell-artwork-item.horizontal-artwork {
        grid-column: span 1; /* Each artwork takes 1 column */
      }

      #digitalUpsellModalContent .upsell-artwork-item {
        aspect-ratio: auto; /* Let images determine their own ratio */
      }

      #digitalUpsellModalContent .upsell-artwork-item {
        border-radius: 12px;
      }

      #digitalUpsellModalContent .upsell-artwork-item:hover {
        transform: scale(1);
      }

      #digitalUpsellModalContent .upsell-artwork-item .upsell-image-wrapper {
        min-height: 150px;
      }

      .upsell-bottom-bar button {
        font-size: 14px;
        padding: 12px 14px;
      }

      #digitalUpsellModalContent .upsell-watermark-pattern {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
      }

      #digitalUpsellModalContent .upsell-watermark {
        font-size: 0.7rem;
      }

      #digitalUpsellModalContent .scroll-indicator {
        display: none;
      }

      #digitalUpsellModalContent .scroll-indicator-arrow {
        font-size: 0.85rem;
      }

      #digitalUpsellModalContent .upsell-selected-count {
        font-size: 0.8rem;
        padding: 0.4rem;
      }

      /* Hide bottom warning on mobile since buttons are on top */
      #digitalUpsellModalContent > div:last-child {
        display: none;
      }
    }

    @media (max-width: 600px) {
      #digitalUpsellModalContent .upsell-artworks-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile to show more artworks */
        gap: 8px;
      }

      /* MOBILE: Each artwork takes 1 column in 2-col grid */
      #digitalUpsellModalContent .upsell-artwork-item {
        grid-column: span 1 !important;
        aspect-ratio: auto !important;
        width: 100%;
      }

      /* On mobile: ALL artworks show their actual ratio */
      #digitalUpsellModalContent .upsell-artwork-item.horizontal-artwork {
        grid-column: span 1 !important;
        aspect-ratio: auto !important;
      }

      /* Images in upsell modal fill width, height adjusts to maintain actual ratio */
      #digitalUpsellModalContent .upsell-artwork-item img {
        object-fit: contain !important;
        width: 100%;
        height: auto !important;
        min-height: 120px !important; /* Smaller min-height on mobile for lazy load placeholder */
      }

      #digitalUpsellModalContent .upsell-artwork-item .upsell-image-wrapper {
        min-height: 120px;
      }
    }

    @media (max-width: 400px) {
      #digitalUpsellModalContent {
        padding: 0.75rem;
        padding-bottom: 1.25rem;
      }

      #digitalUpsellModalContent h3 {
        font-size: 1rem;
      }

      #digitalUpsellModalContent .upsell-artwork-item .upsell-image-wrapper {
        min-height: 100px;
      }

      #digitalUpsellModalContent .upsell-artwork-item img {
        min-height: 100px !important;
      }

      .upsell-bottom-bar button {
        font-size: 12px;
        padding: 10px 6px;
      }
    }

    /* Desktop with short height - keep the grid scrollable */
    @media (max-height: 700px) and (min-width: 1025px) {
      #digitalUpsellModalContent {
        padding: 0.75rem;
        max-height: calc(100vh - 20px);
      }

      #digitalUpsellModalContent h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
      }

      #digitalUpsellModalContent .upsell-subtitle {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
      }

      #digitalUpsellModalContent .upsell-price-highlight {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.4rem;
      }

      #digitalUpsellModalContent .upsell-artworks-grid {
        min-height: 100px;
      }

    }
  