#nbpacks-popup {
     overflow-x: hidden;   /* keep x hidden */
     overflow-y: auto;     /* enable vertical scroll */
     min-height: 0;  
}
#nbpacks-success-message {
    font-size: 2rem !important;
}
body.modal-open {
  overflow: hidden !important; /* Prevent background scroll when popup is open */
}

form input[type=number] {
    max-width: 200px !important; 
    padding: 0 0 0 8px;
}

/* =========== CONTAINER & LAYOUT ====================================== */
.nbpacks-container {
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nbpacks-packs-grid h2 {
    text-align: center;
    margin-bottom: 3rem;
    color: #1a1a1a;
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
}

.nbpacks-packs-grid h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #06549B, #1976d2);
    border-radius: 2px;
}

/* =========== PACK DISPLAY ============================================= */
.nbpacks-pack {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nbpacks-pack:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.nbpacks-pack-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #1a1a1a;
    font-size: 3rem;
    font-weight: 600;
    position: relative;
}

.nbpacks-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.nbpacks-category {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.nbpacks-category:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.nbpacks-category-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.nbpacks-category:hover .nbpacks-category-img {
    transform: scale(1.05);
}

.nbpacks-category-label {
    padding: 1.25rem;
    background: linear-gradient(135deg, #06549B, #1976d2);
    color: white;
    font-weight: 600;
    font-size: 1.6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.nbpacks-category-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nbpacks-category:hover .nbpacks-category-label::before {
    left: 100%;
}

/* =========== FULL SCREEN POPUP ======================================= */
.nbpacks-popup-content {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 1440px;
  max-height: 90vh;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.nbpacks-popup-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 80px); /* adjust if header/footer size changes */
  padding: 2rem;
}

/* Optional: fix the header to top if needed */
.nbpacks-popup-header {
  flex-shrink: 0;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}


.nbpacks-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hidden popup */
.nbpacks-popup.nbpacks-hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
}

/* Active popup */
.nbpacks-popup.nbpacks-active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Debug: Force popup to be visible for testing */
.nbpacks-popup[style*="display: block"],
.nbpacks-popup[style*="display: flex"] {
    opacity: 1 !important;
    visibility: visible !important;
}

.nbpacks-popup-content {
  background: #fff;
  border-radius: 20px;

  /* sizing */
  width: 90%;
  max-width: 1440px;
  max-height: 90vh;

  /* make it scrollable */
  overflow-x: hidden;   /* keep x hidden */
  overflow-y: auto;     /* enable vertical scroll */
  min-height: 0;        /* ← KEY for flex items */

  /* optional: smoother mobile scrolling */
   -webkit-overflow-scrolling: touch; 

  /* visual polish */
  box-shadow: 0 25px 50px rgba(0 0 0 / 0.25);
  transform: scale(0.9) translateY(20px);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.nbpacks-popup.nbpacks-active .nbpacks-popup-content {
    transform: scale(1) translateY(0);
}

.nbpacks-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #06549B, #1976d2);
    color: white;
    position: relative;
}

.nbpacks-popup-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.nbpacks-popup-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nbpacks-popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

.nbpacks-popup-body {
    padding: 2rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* =========== STEP STYLES ============================================== */
.nbpacks-step {
    display: none;
}

.nbpacks-step.nbpacks-active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nbpacks-step-content {
    text-align: center;
}

.nbpacks-step h4 {
    color: #1a1a1a;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.nbpacks-step-description {
    color: #666;
    font-size: 1.6rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* =========== QUANTITY INPUT =========================================== */
.nbpacks-quantity-input {
    margin: 2rem 0;
}

.nbpacks-quantity-input label {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.nbpacks-quantity-input input {
    width: 200px;
    padding: 1rem 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nbpacks-quantity-input input:focus {
    outline: none;
    border-color: #06549B;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

/* =========== DYNAMIC FIELDS =========================================== */
.nbpacks-dynamic-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.nbpacks-fieldset {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.nbpacks-fieldset:hover {
    border-color: #06549B;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
}

.nbpacks-fieldset > legend {
    background: linear-gradient(135deg, #06549B, #1976d2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nbpacks-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.nbpacks-fields label {
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    display: block;
}

.nbpacks-fields label span {
    color: #ef4444;
    font-weight: 600;
}

.nbpacks-fields select,
.nbpacks-fields input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.nbpacks-fields select:focus,
.nbpacks-fields input:focus {
    outline: none;
    border-color: #06549B;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}



/* =========== CONTACT FIELDS =========================================== */
.nbpacks-contact-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.nbpacks-field-group {
    text-align: left;
}

.nbpacks-field-group label {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.nbpacks-field-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nbpacks-field-group input:focus {
    outline: none;
    border-color: #06549B;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

/* =========== BUTTONS ================================================== */
.nbpacks-step-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.nbpacks-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.nbpacks-btn-primary {
    background: linear-gradient(135deg, #06549B, #1976d2);
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.nbpacks-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.nbpacks-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nbpacks-btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.nbpacks-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* =========== TOTAL SECTION ============================================ */
.nbpacks-total-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    text-align: center;
}

#nbpacks-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #06549B;
    transition: all 0.3s ease;
}

#nbpacks-total.nbpacks-hidden {
    display: none !important;
}

#nbpacks-total span {
    color: #06549B;
    font-size: 1.8rem;
    font-weight: 800;
}

/* =========== LOADING OVERLAY ========================================== */
.nbpacks-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nbpacks-loading-overlay.nbpacks-active {
    opacity: 1;
    visibility: visible;
}

.nbpacks-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #06549B;
    border-radius: 50%;
    animation: nbpacks-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes nbpacks-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.nbpacks-loading-overlay p {
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* =========== VALIDATION STATES ======================================== */
.nbpacks-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.nbpacks-success {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

.nbpacks-fieldset.nbpacks-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.nbpacks-fieldset.nbpacks-success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* =========== UTILITY CLASSES ========================================== */
.nbpacks-hidden {
    display: none !important;
}

/* =========== RESPONSIVE DESIGN ======================================== */
@media (max-width: 768px) {
    .nbpacks-container {
        padding: 1rem;
    }
    
    .nbpacks-packs-grid h2 {
        font-size: 2rem;
    }
    
    .nbpacks-categories {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .nbpacks-popup-content {
        width: 95%;
        margin: 1rem;
    }
    
    .nbpacks-popup-header {
        padding: 1rem 1.5rem;
    }
    
    .nbpacks-popup-body {
        padding: 1.5rem;
    }
    
    .nbpacks-dynamic-fields {
        grid-template-columns: 1fr;
        max-height: 300px;
    }
    
    .nbpacks-step-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .nbpacks-btn {
        width: 100%;
        font-family: 18px;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .nbpacks-pack {
        padding: 1.5rem;
    }
    
    .nbpacks-category-img {
        height: 180px;
    }
    
    .nbpacks-popup-header h3 {
        font-size: 1.3rem;
    }
    
    .nbpacks-step h4 {
        font-size: 1.5rem;
    }
    
    .nbpacks-quantity-input input {
        width: 150px;
        padding: 0.875rem 1.25rem;
    }
}

/* =========== SCROLLBAR STYLING ======================================== */
.nbpacks-dynamic-fields::-webkit-scrollbar {
    width: 6px;
}

.nbpacks-dynamic-fields::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nbpacks-dynamic-fields::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.nbpacks-dynamic-fields::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.nbpacks-popup-body::-webkit-scrollbar {
    width: 6px;
}

.nbpacks-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.nbpacks-popup-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.nbpacks-popup-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}