* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --compose-bg:          #FFFBEF;
  --compose-paper:       #FFFEFA;
  --compose-ink:         #6C6A5D;
  --compose-muted:       #C2C4B6;
  --compose-accent:      #C2B254;
  --compose-accent-dark: #B28A83;
  --compose-border:      rgba(194, 196, 182, 0.4);
  --compose-shadow:      0 18px 42px rgba(108, 106, 93, 0.08);
}

body {
  font-family: var(--font-body);
  color: var(--compose-ink);
  background-color: #fffaf9;
}

.layout-container {
  max-width: 1760px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.options-sidebar {
  background: #FFFFFF;
  border: 1px solid #D4D2E3;
  border-radius: 18px;
  box-shadow: var(--compose-shadow);
  padding: 18px;
}

.options-sidebar h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.25rem;
  color: #B28A83;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.opt-section {
  margin-bottom: 16px;
}

.opt-content small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  color: var(--compose-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.opt-selectable .opt-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  grid-template-rows: auto auto auto;
  align-items: stretch;
  column-gap: 10px;
  row-gap: 3px;
}

.opt-selectable .opt-content strong {
  font-family: var(--font-assistant);
  font-size: 0.95rem;
  color: #6C6A5D;
  grid-column: 1;
  grid-row: 1;
}

.opt-selectable .opt-content small {
  grid-column: 1;
  grid-row: 2;
}

.opt-selectable .opt-content small::after {
  content: "Cliquer pour selectionner";
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  color: #C2C4B6;
  line-height: 1.2;
}

.opt-image {
  width: 78px;
  height: 100%;
  min-height: 116px;
  margin-top: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C2C4B6;
  font-size: 0.66rem;
  text-align: center;
  padding: 5px;
  border: 1px solid rgba(194, 196, 182, 0.4);
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.opt-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.color-option {
  appearance: none;
  background: #FFFFFF;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.color-option:hover {
  border-color: rgba(194, 178, 84, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(194, 178, 84, 0.12);
}

.color-box {
  width: 42px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(194, 196, 182, 0.4);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.color-option.active {
  border: 2px solid var(--compose-accent);
  background: rgba(194, 178, 84, 0.07);
  box-shadow: 0 10px 20px rgba(194, 178, 84, 0.18);
}

.opt-selectable {
  cursor: pointer;
  border-radius: 14px;
  border: 1px dashed rgba(194, 178, 84, 0.5);
  background: linear-gradient(160deg, rgba(194, 178, 84, 0.07), rgba(194, 178, 84, 0.02));
  padding: 11px;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.opt-selectable:hover {
  transform: translateY(-2px);
  border-color: var(--compose-accent);
  box-shadow: 0 10px 20px rgba(194, 178, 84, 0.12);
}

.opt-selectable.active {
  border: 2px solid var(--compose-accent);
  box-shadow: 0 12px 24px rgba(194, 178, 84, 0.2);
}

.opt-selectable.active .opt-content small::after {
  content: "Selectionne";
  color: #C2B254;
  font-weight: 600;
}

.main-content-compose-bouquet {
  min-width: 0;
}

.composer-page {
  border-radius: 20px;
  border: 1px solid var(--compose-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 254, 250, 0.98)),
    repeating-linear-gradient(45deg, rgba(194, 178, 84, 0.025) 0 2px, transparent 2px 8px);
  padding: 20px;
  box-shadow: var(--compose-shadow);
}

.page-header {
  text-align: center;
  margin-bottom: 22px;
}

.page-header h1 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: 0.02em;
  color: #B28A83;
  line-height: 1.05;
}

.page-header p {
  font-family: var(--font-body);
  max-width: 720px;
  margin: 10px auto 0;
  color: #6C6A5D;
  font-size: 0.95rem;
  line-height: 1.6;
}

.free-delivery-banner {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(194, 178, 84, 0.5);
  background: linear-gradient(135deg, #FFFBEF, #FFFEFA);
  color: #C2B254;
  font-family: var(--font-assistant);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.flowers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flower-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: #FFFFFF;
  border: 1px solid #D4D2E3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(108, 106, 93, 0.07);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.flower-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(108, 106, 93, 0.1);
}

.flower-image {
  background: linear-gradient(160deg, #FFFBEF 0%, #FFFEFA 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  width: 100%;
  height: clamp(170px, 26vw, 255px);
}

.flower-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flower-info {
  padding: 10px 10px 11px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 118px;
}

.flower-name {
  font-family: var(--font-assistant);
  font-size: 1rem;
  font-weight: 700;
  color: #6C6A5D;
  margin-bottom: 5px;
}

.flower-description {
  font-family: var(--font-description);
  font-size: 0.78rem;
  line-height: 1.35;
  color: #C2C4B6;
  min-height: 2.2em;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flower-price {
  font-family: var(--font-assistant);
  font-size: 0.95rem;
  font-weight: 700;
  color: #C2B254;
  margin-bottom: 6px;
}

/* ── Badge stock fleur ───────────────────────────────────────── */
.flower-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 7px;
  width: fit-content;
}

.flower-stock-low {
  background-color: #fff8e6;
  color: #9a6200;
}

.flower-stock-empty {
  background-color: #f5f5f5;
  color: #888;
}

/* Carte grisée quand épuisée */
.flower-card-empty {
  opacity: 0.7;
  filter: grayscale(30%);
}

.flower-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}

.qty-btn {
  width: 31px;
  height: 31px;
  border-radius: 999px;
  border: 1px solid var(--compose-accent);
  background: #FFFFFF;
  color: #B28A83;
  font-size: 1rem;
  cursor: pointer;
  transition: all 160ms ease;
}

.qty-btn:hover:not(:disabled) {
  background: var(--compose-accent);
  color: #FFFFFF;
}

.qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-display {
  min-width: 20px;
  text-align: center;
  font-family: var(--font-assistant);
  font-weight: 700;
  color: #6C6A5D;
}

.add-to-cart-btn {
  border: 2px solid #c2b254;
  border-radius: 30px;
  background: #FFFFFF;
  color: #c2b254;
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-subtitle);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  min-height: 40px;
  transition: all 0.3s;
}

.add-to-cart-btn:hover {
  background-color: #c9a961;
  color: #FFFFFF;
}

.add-to-cart-btn.added {
  animation: addToCartPulse 420ms ease;
}

@keyframes addToCartPulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(194, 196, 182, 0.4);
  background: #FFFFFF;
  color: #6C6A5D;
  font-family: var(--font-assistant);
  cursor: pointer;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
  background: var(--compose-accent);
  border-color: var(--compose-accent);
  color: #FFFFFF;
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cart-summary {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  max-height: min(56vh, 480px);
  overflow: auto;
  background: rgba(255, 254, 250, 0.98);
  border: 1px solid rgba(194, 196, 182, 0.4);
  border-radius: 16px;
  box-shadow: 0 24px 40px rgba(108, 106, 93, 0.15);
  padding: 14px;
  z-index: 999;
}

.cart-summary h3 {
  font-family: var(--font-body);
  font-weight: 700;
  color: #B28A83;
  margin-bottom: 10px;
  font-size: 1.08rem;
}

.cart-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-body);
  color: #6C6A5D;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.cart-summary-total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(194, 196, 182, 0.3);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-assistant);
  font-weight: 700;
  color: #C2B254;
}

.cart-free-delivery-hint {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: #C2C4B6;
}

.share-custom-btn {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #C2B254;
  border-radius: 999px;
  background: #FFFFFF;
  color: #C2B254;
  min-height: 42px;
  padding: 10px 14px;
  font-family: var(--font-assistant);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.2s;
}

.share-custom-btn:hover {
  background: #FFFBEF;
}

.validate-btn {
  position: relative;
  margin-top: 10px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #C2B254, #b0a148);
  color: #FFFFFF;
  min-height: 44px;
  padding: 10px 14px;
  font-family: var(--font-assistant);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.validate-btn:hover {
  filter: brightness(0.95);
}

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 270px;
  max-width: 370px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #FFFFFF;
  border-left: 4px solid var(--compose-accent);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  transform: translateX(110%);
  opacity: 0;
  transition: transform 320ms ease, opacity 320ms ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(110%);
  opacity: 0;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-family: var(--font-assistant);
  font-size: 0.92rem;
  font-weight: 700;
  color: #6C6A5D;
  margin-bottom: 3px;
}

.toast-message {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: #C2C4B6;
  line-height: 1.35;
}

.toast-close {
  border: none;
  background: transparent;
  color: #C2C4B6;
  font-size: 1.1rem;
  cursor: pointer;
}

.toast-progress {
  position: absolute;
  left: 4px;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 0 0 12px 0;
  overflow: hidden;
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--compose-accent);
  animation: toastProgress var(--toast-duration, 4s) linear forwards;
}

.toast.success {
  border-left-color: #4caf50;
}

.toast.success .toast-progress-bar {
  background: #4caf50;
}

.toast.error {
  border-left-color: #e53935;
}

.toast.error .toast-progress-bar {
  background: #e53935;
}

.toast.warning {
  border-left-color: #F0DE7B;
}

.toast.warning .toast-progress-bar {
  background: #F0DE7B;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ── Floating checkout button ── */

@keyframes floatingPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.02); }
}

@media (min-width: 700px) {
  .layout-container {
    padding: 24px;
  }

  .flowers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
  }

  .cart-summary {
    left: auto;
    right: 20px;
    width: min(390px, calc(100vw - 40px));
  }
}

@media (min-width: 1080px) {
  .layout-container {
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 28px;
  }

  .options-sidebar {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
  }

  .flowers-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .composer-page {
    padding: 28px;
  }
}

@media (min-width: 1440px) {
  .flowers-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 700px) {
  .opt-colors {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .color-option {
    padding: 9px 6px;
    gap: 6px;
    min-height: 48px;
    border-radius: 10px;
  }

  .color-box {
    width: 100%;
    max-width: 34px;
    height: 20px;
    border-radius: 7px;
  }

  .color-option span {
    font-size: 0.72rem !important;
    line-height: 1.1;
  }

  .opt-selectable .opt-content {
    grid-template-columns: minmax(0, 1fr) 66px;
    grid-template-rows: auto auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
  }

  .opt-selectable .opt-content strong {
    font-size: 0.88rem;
  }

  .opt-selectable .opt-content small {
    margin-top: 0;
    grid-column: 1;
    grid-row: 2;
    font-size: 0.73rem;
    line-height: 1.3;
  }

  .opt-selectable .opt-image {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 66px;
    height: 100%;
    min-height: 102px;
    margin-top: 0;
    border-radius: 11px;
    font-size: 0.58rem;
    text-align: center;
    padding: 4px;
  }

}

@media (max-width: 460px) {
  .flower-card {
    min-height: 340px;
  }

  .flower-image {
    height: 182px;
  }

  .flower-name {
    font-size: 0.9rem;
  }

  .flower-description {
    font-size: 0.73rem;
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
  }

  .flower-price {
    font-size: 0.86rem;
    margin-bottom: 6px;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
  }

  .add-to-cart-btn {
    min-height: 34px;
    font-size: 0.76rem;
  }

  .opt-colors {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .color-option {
    min-height: 46px;
    padding: 8px 6px;
  }

  .color-box {
    max-width: 32px;
    height: 18px;
  }

  .page-header p {
    font-size: 0.88rem;
  }

  .toast-container {
    top: auto;
    bottom: 14px;
    left: 10px;
    right: 10px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }
}
