/* Product Card Modal Styles */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    pointer-events: none;
  }

  .modal-overlay.show {
    display: flex;
    pointer-events: auto;
  }
  
  .modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 75rem;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.3);
    position: relative;
    overflow: visible;
    pointer-events: auto;
  }

  .modal-header {
    padding: 2rem !important;
    border-bottom: 0.125rem solid #e0e0e0;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
  }

  .modal-title {
    font-size: 3.75rem !important;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding-right: 4rem;
    line-height: 1.1 !important;
  }

  .modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 4rem !important;
    line-height: 1;
    color: #90a4ae;
    padding: 0;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
  }

  .modal-close:hover {
    color: #546e7a;
  }

  /* Variant of modal close button used inside the orange "Schedule for" header */
  .schedule-picker-close {
    position: static;
  }

  .modal-body {
    padding: 2rem !important;
    overflow-y: auto;
    flex: 1;
    position: relative;
  }

  .form-row {
    margin-bottom: 1.5rem !important;
  }

  .form-group {
    display: flex;
    flex-direction: column;
  }

  .form-label {
    font-size: 2.5rem !important;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.75rem !important;
    line-height: 1.2 !important;
  }

  .form-input, .form-select, .form-textarea {
    font-size: 2.5rem !important;
    padding: 2.5rem 3rem !important;
    border: 0.125rem solid #cfd8dc;
    border-radius: 1.5625rem;
    transition: border-color 0.2s;
    font-family: inherit;
    min-height: 7rem !important;
    line-height: 1.2 !important;
  }

  .form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 3rem center;
    background-size: 3rem;
    padding-right: 8rem !important;
    background-color: white;
  }

  .form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #4285f4;
  }

  .form-textarea {
    resize: vertical;
    min-height: 12.5rem !important;
  }

  .form-input.error, .form-select.error, .form-textarea.error {
    border-color: #c33;
  }

  .form-error {
    color: #c33;
    font-size: 2rem !important;
    margin-top: 0.5rem;
    line-height: 1.2 !important;
  }

  .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 0.5rem;
  }

  /* Style "Tag/Chip" pour les allergènes */
  .checkbox-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.6rem 2.4rem;
    background: white;
    border: 0.125rem solid #90a4ae;
    border-radius: 1rem;
    cursor: pointer;
    transition: none;
    font-size: 2.2rem !important;
    font-weight: 600; /* Garder la largeur constante entre coché / non coché */
    color: #4a4a4a;
    user-select: none;
    min-width: 7.5rem;
    text-align: center;
    touch-action: manipulation;           /* Améliore la réactivité sur mobile (iOS) */
    -webkit-tap-highlight-color: transparent; /* Supprime le flash gris sur iOS */
  }

  .checkbox-item:hover {
    background: #fcfcfc;
    border-color: #ccc;
  }

  /* Cacher la checkbox native mais la laisser interactive pour l'accessibilité */
  .checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
  }

  /* État sélectionné */
  .checkbox-item.checked {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #1967d2;
  }

  .checkbox-item span {
    pointer-events: none;
  }

  .price-overrides-section {
    margin-top: 1rem;
  }

  .price-override-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
  }

  .price-override-item .form-label {
    font-size: 2.5rem !important;
    min-width: 12.5rem;
    margin-bottom: 0 !important;
    text-align: right;
    justify-content: flex-end;
  }

  .price-override-item .form-input {
    flex: 1;
  }

  .modal-footer {
    padding: 2rem !important;
    border-top: 0.125rem solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-direction: column;
  }

  .btn-primary {
    background: #4285f4;
    color: white;
    border: none;
    padding: 2.5rem 3rem !important;
    border-radius: 1.5625rem;
    cursor: pointer;
    font-size: 2.5rem !important;
    font-weight: 600;
    min-height: 7rem !important;
    line-height: 1.2 !important;
  }

  .btn-primary:hover {
    background: #357ae8;
  }

  .btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 0.125rem solid #e0e0e0;
    padding: 2.5rem 3rem !important;
    border-radius: 1.5625rem;
    cursor: pointer;
    font-size: 2.5rem !important;
    font-weight: 600;
    min-height: 7rem !important;
    line-height: 1.2 !important;
  }

  .btn-secondary:hover {
    background: #e0e0e0;
  }

  .btn-schedule {
    background: #FF8C00;
    color: white;
    border: none;
    padding: 2.5rem 1.5rem !important;
    border-radius: 1.5625rem;
    cursor: pointer;
    font-size: 2.5rem !important;
    font-weight: 600;
    min-height: 7rem !important;
    line-height: 1.2 !important;
    transition: background 0.2s;
  }

  .btn-schedule:hover:not(:disabled) {
    background: #FF7700;
  }

  .btn-schedule:disabled {
    cursor: not-allowed;
  }

  /* Status Buttons (Delete / Disabled) */
  .status-buttons-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    margin-top: 1rem;
  }

  .status-btn {
    flex: 1;
    padding: 2.5rem;
    border-radius: 1rem;
    border: 0.125rem solid transparent;
    font-size: 2.8rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Delete Button Styles */
  .status-btn-delete {
    background-color: #ffebee;
    color: #c62828;
    border: 0.125rem solid #ef9a9a;
  }

  .status-btn-delete:hover {
    background-color: #ffcdd2;
  }

  .status-btn-delete.active {
    background-color: #c62828;
    color: white;
    border-color: #c62828;
    box-shadow: inset 0 0.125rem 0.25rem rgba(0,0,0,0.2);
  }

  /* Disabled Button Styles */
  .status-btn-disabled {
    background-color: #eceff1;
    color: #546e7a;
    border: 0.125rem solid #cfd8dc;
  }

  .status-btn-disabled:hover {
    background-color: #cfd8dc;
  }

  .status-btn-disabled.active {
    background-color: #546e7a;
    color: white;
    border-color: #546e7a;
    box-shadow: inset 0 0.125rem 0.25rem rgba(0,0,0,0.2);
  }

  .schedule-picker {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
    background: #FF7700;
    border-radius: 0.375rem;
    width: 100%;
  }

  .schedule-picker.show {
    display: block;
  }

  .schedule-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
  }

  .schedule-buttons button {
    flex: 1;
    padding: 2.5rem 3rem !important;
    font-size: 2.5rem !important;
    min-height: 7rem !important;
    border: 0.125rem solid #e0e0e0;
    border-radius: 1.5625rem;
    background: white;
    cursor: pointer;
    font-weight: 600;
  }

  .schedule-buttons button:hover {
    background: #f5f5f5;
    border-color: #4285f4;
  }

  .schedule-buttons input[type="date"],
  .schedule-buttons input[type="time"] {
    flex: 1;
    position: relative;
    z-index: 10002 !important;
    pointer-events: auto !important;
    cursor: pointer;
    background: white;
    border-radius: 1.5625rem;
  }
  
  /* Ensure date/time pickers can appear above modal */
  .modal-content {
    overflow: visible !important;
  }
  
  .modal-footer {
    position: relative;
    z-index: 1;
    overflow: visible;
  }
  
  .schedule-picker {
    overflow: visible;
    position: relative;
    z-index: 1;
  }
  
  .schedule-buttons {
    position: relative;
    z-index: 1;
    overflow: visible;
  }


  .modal-footer-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
  }

  .modal-footer-buttons button {
    flex: 1;
  }

  .checkbox-label-inline {
    display: flex;
    align-items: center;
    font-size: 2.5rem !important;
    font-weight: 600;
    color: #666;
    line-height: 1.2 !important;
  }

  .checkbox-label-inline input[type="checkbox"] {
    width: 3rem;
    height: 3rem;
    margin-right: 1rem;
    cursor: pointer;
    flex-shrink: 0;
  }

  .checkbox-label-large {
    display: flex;
    align-items: center;
    font-size: 3rem !important;
    font-weight: 600;
    color: #666;
    line-height: 1.2 !important;
    cursor: pointer;
    padding: 1.5rem 0;
    gap: 1.5rem;
  }

  .checkbox-label-large input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
  }

  .checkbox-label-large .checkbox-custom {
    width: 4.5rem;
    height: 4.5rem;
    border: 0.1875rem solid #c33;
    border-radius: 0.375rem;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
  }

  .checkbox-label-large .checkbox-custom::after {
    content: '';
    width: 2.5rem;
    height: 1.5rem;
    border: 0.1875rem solid white;
    border-top: none;
    border-right: none;
    transform: rotate(-45deg);
    opacity: 0;
    transition: opacity 0.2s;
    position: absolute;
  }

  .checkbox-label-large.checked .checkbox-custom {
    background: #c33;
    border-color: #c33;
  }

  .checkbox-label-large.checked .checkbox-custom::after {
    opacity: 1;
  }

  .checkbox-label-large:hover .checkbox-custom {
    background: #ffe0e0;
    border-color: #c33;
  }

  .checkbox-label-large.checked:hover .checkbox-custom {
    background: #a00;
    border-color: #a00;
  }

  .checkbox-label-large .checkbox-text {
    color: #c33;
    font-weight: 600;
  }

  .checkbox-label-large.checked .checkbox-text {
    color: #c33;
  }
  
  /* Retail Taxable checkbox overrides (neutral styling) */
  #retailTaxableRow .checkbox-label-large .checkbox-custom {
    border-color: #cfd8dc;
    background: #fff;
  }

  #retailTaxableRow .checkbox-label-large .checkbox-text {
    color: #333 !important;
  }

  #retailTaxableRow .checkbox-label-large input[type="checkbox"]:checked + .checkbox-custom {
    background: #4285f4;
    border-color: #4285f4;
  }

  #retailTaxableRow .checkbox-label-large input[type="checkbox"]:checked + .checkbox-custom::after {
    opacity: 1;
  }

  #retailTaxableRow .checkbox-label-large:hover .checkbox-custom {
    background: #f5f5f5;
    border-color: #cfd8dc;
  }

  #retailTaxableRow .checkbox-label-large input[type="checkbox"]:checked:hover + .checkbox-custom {
    background: #357ae8;
    border-color: #357ae8;
  }

  #retailTaxableRow .checkbox-label-large input[type="checkbox"]:checked ~ .checkbox-text {
    color: #333 !important;
  }
  
  /* Has a Kitchen label - specific styling */
  #hasKitchenLabelRow .checkbox-label-large {
    background: #f0fdf4;
    border-radius: 0.75rem;
    padding: 1.4rem 2rem;
    margin: 0;
  }
  
  #hasKitchenLabelRow .checkbox-label-large .checkbox-custom {
    width: 3.6rem;
    height: 3.6rem;
    border: 0.125rem solid #2e7d32;
    border-radius: 0.375rem;
    background: white;
  }
  
  /* État sélectionné pour Kitchen Label */
  #hasKitchenLabelRow .checkbox-label-large.checked .checkbox-custom {
    background: #2e7d32;
    border-color: #2e7d32;
  }
  
  #hasKitchenLabelRow .checkbox-label-large .checkbox-custom::after {
    width: 2.4rem;
    height: 1.44rem;
    border-width: 0.15rem;
    border-color: white;
  }
  
  #hasKitchenLabelRow .checkbox-label-large:hover .checkbox-custom {
    border-color: #1b5e20;
  }
  
  #hasKitchenLabelRow .checkbox-label-large.checked:hover .checkbox-custom {
    background: #1b5e20;
    border-color: #1b5e20;
  }
  
  #hasKitchenLabelRow .checkbox-label-large .checkbox-text {
    color: #137333;
    font-weight: 600;
  }
  
  #hasKitchenLabelRow .checkbox-label-large.checked .checkbox-text {
    color: #137333;
  }
  
  .only-in-square-note {
    color: #333;
    margin-top: 0.75rem;
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
  
  .store-availability-buttons {
    display: flex;
    gap: 1rem;
    border: none;
    border-radius: 0;
    overflow: visible;
    width: 100%;
  }
  
  .store-availability-buttons button {
    flex: 1;
    padding: 1.5rem 2rem;
    font-size: 2.5rem !important;
    font-weight: 600;
    border: none;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: none;
    border-radius: 1.5625rem;
  }
  
  .store-availability-buttons button:hover {
    background: #e8e8e8;
  }
  
  .store-availability-buttons button.active {
    background: #4a90e2;
    color: white;
  }

  /* Photo field layout */
  .photo-field-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .photo-display-card {
    position: relative;
    border: 0.125rem dashed #cbd5e1;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 1.5rem;
    min-height: 15rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .photo-display-image {
    max-width: 100%;
    max-height: 25rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    object-fit: contain;
  }

  .photo-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
  }

  .photo-loading-spinner {
    border: 0.25rem solid #f3f3f3;
    border-top: 0.25rem solid #4a90e2;
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    animation: spin 1s linear infinite;
    margin: 0 auto;
  }

  .photo-loading-text {
    font-size: 1.8rem;
    color: #666;
  }

  .photo-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
    font-size: 1.8rem;
  }

  .photo-placeholder-text {
    color: #999;
    font-style: italic;
  }

  .photo-retry-button {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 50%;
    width: 7.2rem;
    height: 7.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    padding: 0;
  }

  .photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
  }

  .photo-action-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #1a73e8;
    font-size: 2rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
  }

  .photo-action-link:hover {
    text-decoration: underline;
  }

  .photo-claim-container {
    margin: 1.5rem 0;
    padding: 2.5rem;
    background-color: #fefce8;
    border: 0.0625rem solid #fef08a;
    border-radius: 1.5rem;
  }

  .photo-claim-empty {
    text-align: center;
    padding: 2rem;
    font-size: 2rem;
    color: #64748b;
    margin-bottom: 1.5rem;
  }

  .photo-claim-button {
    width: 100%;
    border: none;
    border-radius: 624.9375rem;
    background-color: #4b5563;
    color: #f9fafb;
    font-size: 2.5rem;
    font-weight: 700;
    padding: 2.5rem 2rem;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.05s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
  }

  .photo-claim-button:hover {
    background-color: #374151;
  }

  .photo-claim-button:active {
    transform: translateY(0.0625rem);
  }

  .photo-claim-button svg {
    width: 3.5rem;
    height: 3.5rem;
  }

  .photo-placeholder-upload {
    font-size: 1.8rem;
  }

  .photo-upload-icon {
    width: 3.2rem;
    height: 3.2rem;
    margin-bottom: 0.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23b0b7c3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 17v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-1'/%3E%3Cpolyline points='7 9 12 4 17 9'/%3E%3Cline x1='12' y1='4' x2='12' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
  }
  
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    /* Image Fullscreen Modal */
    .image-modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.9);
      z-index: 10003;
      justify-content: center;
      align-items: center;
      pointer-events: none;
    }

    .image-modal-overlay.show {
      display: flex;
      pointer-events: auto;
    }

    .image-modal-content {
      position: relative;
      width: 100%;
      max-width: 100vw;
      padding: 2rem;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .image-modal-content img {
      width: 100%;
      max-width: 100%;
      height: auto;
      max-height: 90vh;
      object-fit: contain;
    }

    .image-modal-close {
      position: absolute;
      top: 2rem;
      right: 2rem;
      background: rgba(255, 255, 255, 0.9);
      border: none;
      width: 6rem;
      height: 6rem;
      border-radius: 50%;
      font-size: 4rem;
      color: #dc3545;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      z-index: 10004;
    }

    .image-modal-close:hover {
      background: white;
    }

    /* Item Group Autocomplete Suggestions */
    .item-group-suggestions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.75rem;
      margin-top: 0.75rem;
    }

    .item-group-suggestion-btn {
      background: #f5f5f5;
      color: #333;
      border: 0.0625rem solid #e0e0e0;
      padding: 0.75rem 1.5rem;
      border-radius: 1.5625rem;
      cursor: pointer;
      font-size: 2rem !important;
      font-weight: 500;
      transition: background-color 0.2s, border-color 0.2s;
      line-height: 1.2 !important;
    }

    .item-group-suggestion-btn:hover {
      background: #e0e0e0;
      border-color: #4285f4;
    }

    /* Status Toggles (Delete / Disabled) */
    .status-toggle-container,
    .status-buttons-container {
      display: flex;
      gap: 2rem;
      align-items: center;
    }

  .toggle-btn,
  .status-btn {
    border: none;
    background: transparent;
    padding: 1.5rem 3rem;
    border-radius: 1rem;
    font-size: 3.2rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

    .toggle-btn-delete,
    .status-btn-delete {
      color: #ef5350;
      background-color: #fffafa; /* Even lighter red background when inactive */
    }

    .toggle-btn-delete:hover,
    .status-btn-delete:hover {
      background-color: #ffecec;
    }

    .toggle-btn-delete.active,
    .status-btn-delete.active {
      background-color: #ffe5e5;
      color: #c62828;
      box-shadow: inset 0 0 0 0.125rem #c62828;
    }

    .toggle-btn-disabled,
    .status-btn-disabled {
      color: #78909c;
      background-color: #f8fafc; /* Even lighter grey background when inactive */
    }

    .toggle-btn-disabled:hover,
    .status-btn-disabled:hover {
      background-color: #eceff4;
    }

    .toggle-btn-disabled.active,
    .status-btn-disabled.active {
      background-color: #e0e6f0;
      color: #455a64;
      box-shadow: inset 0 0 0 0.125rem #455a64;
    }

  /* Hide Delete button in Add Product mode (new products) */
  #productModal.is-new-product #btnToggleDelete {
    display: none !important;
  }

  /* Confirm Dialog Styles */
  .confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10005;
    padding: 2rem;
    pointer-events: none;
  }

  .confirm-dialog-overlay.show {
    display: flex;
    pointer-events: auto;
  }

  .confirm-dialog-content {
    background: white;
    border-radius: 1rem;
    max-width: 31.25rem;
    width: 100%;
    padding: 3rem;
    box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.3);
    text-align: center;
    pointer-events: auto;
  }

  .confirm-dialog-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
  }

  .confirm-dialog-title {
    font-size: 3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 1rem 0;
  }

  .confirm-dialog-message {
    font-size: 2.2rem;
    color: #666;
    margin: 0 0 2.5rem 0;
    line-height: 1.4;
  }

  .confirm-dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
  }

  .confirm-dialog-buttons button {
    flex: 1;
    max-width: 12.5rem;
  }

  .btn-danger {
    background: #c62828;
    color: white;
    border: none;
    padding: 2rem 3rem !important;
    border-radius: 1.5625rem;
    cursor: pointer;
    font-size: 2.5rem !important;
    font-weight: 600;
    min-height: 5.625rem !important;
    line-height: 1.2 !important;
    transition: background 0.2s;
  }

  .btn-danger:hover {
    background: #b71c1c;
  }
  