/* =============================================================================
   GIFTS MODAL — ZEO Parfums dark theme
   Ruta: assets/css/gifts-modal.css
============================================================================= */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
#fgw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#fgw-modal-overlay.fgw-visible {
  display: flex;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.fgw-modal {
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  animation: fgwModalIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  overflow: hidden;
}

@keyframes fgwModalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.fgw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
  gap: 12px;
}

.fgw-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.fgw-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #262626;
  color: #737373;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.fgw-modal-close:hover {
  background: #262626;
  color: #fff;
  border-color: #404040;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.fgw-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #262626 transparent;
}

.fgw-modal-body::-webkit-scrollbar {
  width: 4px;
}
.fgw-modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.fgw-modal-body::-webkit-scrollbar-thumb {
  background: #262626;
  border-radius: 2px;
}

/* ── Counter ─────────────────────────────────────────────────────────────── */
.fgw-checkout-notice {
  background: #0d0d1f;
  border: 1px solid #2d2a6e;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.fgw-gifts-counter {
  margin: 0 0 6px;
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.fgw-checkout-notice .description {
  margin: 0;
  color: #525252;
  font-size: 12px;
  line-height: 1.5;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.fgw-gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

/* ── Gift item ───────────────────────────────────────────────────────────── */
.fgw-gift-item {
  background: #111;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  cursor: default;
}

.fgw-gift-item:hover {
  border-color: #534dfa;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(83, 77, 250, 0.15);
}

.fgw-gift-item.selected {
  border-color: #22c55e;
  background: #0a1a12;
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.15);
}

/* Checkmark badge */
.fgw-gift-item.selected::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 20px;
  height: 20px;
  background: #22c55e;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
}

.fgw-gift-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #262626;
  background: #0d0d0d;
  flex-shrink: 0;
}

.fgw-gift-name {
  color: #e5e5e5;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

/* ── Select button ───────────────────────────────────────────────────────── */
.fgw-gift-select {
  background: #534dfa;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition:
    background 0.15s,
    transform 0.15s;
  width: 100%;
}

.fgw-gift-select:hover:not(:disabled):not(.disabled) {
  background: #3f3acc;
  transform: translateY(-1px);
}

.fgw-gift-select.selected {
  background: #22c55e !important;
  color: #fff !important;
}

.fgw-gift-select.selected:hover {
  background: #16a34a !important;
}

.fgw-gift-select:disabled,
.fgw-gift-select.disabled {
  background: #262626 !important;
  color: #525252 !important;
  cursor: not-allowed !important;
  transform: none !important;
  opacity: 0.7;
}

/* ── Quantity ────────────────────────────────────────────────────────────── */
.fgw-gift-quantity-wrapper {
  width: 100%;
  background: #161616;
  border: 1px solid #262626;
  border-radius: 8px;
  padding: 8px 10px;
  display: none;
}

.fgw-gift-quantity-wrapper label {
  display: block;
  font-size: 10px;
  color: #737373;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.fgw-gift-quantity {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #262626;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.2s;
}

.fgw-gift-quantity:focus {
  border-color: #534dfa;
}

/* ── States ──────────────────────────────────────────────────────────────── */
.fgw-loading,
.fgw-error,
.fgw-no-gifts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #525252;
  font-size: 13px;
}

.fgw-error {
  color: #f87171;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.fgw-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid #1a1a1a;
  background: #080808;
  flex-shrink: 0;
  gap: 12px;
  flex-wrap: wrap;
}

.fgw-modal-actions-left {
  flex: 1;
}
.fgw-modal-actions-right {
  display: flex;
  gap: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.fgw-btn {
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  border: none;
  white-space: nowrap;
}

.fgw-confirm-gifts {
  background: #22c55e;
  color: #fff;
}

.fgw-confirm-gifts:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

.fgw-btn-ghost {
  background: transparent;
  color: #525252;
  border: 1px solid #262626;
}

.fgw-btn-ghost:hover {
  background: #161616;
  color: #a3a3a3;
  border-color: #404040;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */
.fgw-notice {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  animation: fgwSlideDown 0.25s ease-out;
}

@keyframes fgwSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fgw-notice-success {
  background: #0a1a12;
  color: #4ade80;
  border: 1px solid #166534;
}
.fgw-notice-warning {
  background: #1a1200;
  color: #fbbf24;
  border: 1px solid #92400e;
}
.fgw-notice-error {
  background: #1a0a0a;
  color: #f87171;
  border: 1px solid #7f1d1d;
}

/* ── Reload overlay ──────────────────────────────────────────────────────── */
.fgw-reload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.fgw-reload-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.fgw-reload-message {
  background: #111;
  border: 1px solid #262626;
  border-radius: 16px;
  padding: 40px 36px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: fgwModalIn 0.3s ease-out both;
}

.fgw-reload-message h3 {
  margin: 16px 0 8px;
  color: #22c55e;
  font-size: 18px;
  font-weight: 800;
}

.fgw-reload-message p {
  margin: 0;
  color: #525252;
  font-size: 13px;
}

.fgw-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #1a1a1a;
  border-top-color: #534dfa;
  border-radius: 50%;
  animation: fgwSpin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes fgwSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Cart label / price ──────────────────────────────────────────────────── */
.fgw-gift-label {
  background: #22c55e;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.free-gift-price {
  color: #22c55e !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
}

body.fgw-modal-open {
  overflow: hidden !important;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .fgw-modal {
    border-radius: 12px;
    max-height: 96vh;
  }

  .fgw-modal-header,
  .fgw-modal-body,
  .fgw-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .fgw-gifts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .fgw-gift-image {
    width: 64px;
    height: 64px;
  }
  .fgw-gift-name {
    font-size: 11px;
  }

  .fgw-modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .fgw-modal-actions-left,
  .fgw-modal-actions-right {
    width: 100%;
  }
  .fgw-btn,
  .fgw-confirm-gifts {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .fgw-gifts-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .fgw-gift-item {
    padding: 12px 10px;
  }
}
