/* ВАЖНО: все @import должны идти ПЕРЕД любыми правилами, иначе браузер может их игнорировать */
@import url('./nature-organic-theme.css');
@import url('./utilities-theme.css');
@import url('./modal.css');
@import url('./cart-button.css');
@import url('./bottom-action-bar.css');
@import url('./category-menu.css');
@import url('./custom-scrollbar.css');
@import url('./quick-add-btn.css');
@import url('./enhanced-ui.css');
@import url('./search-modal-adaptive.css');
@import url('./alpha-product-list-modal.css');
@import url('./unified-modals.css');
/* Новые модульные файлы */
@import url('./product-modal-modern.css');
@import url('./my-reviews-modal.css');
@import url('./buttons.css');
@import url('./auth-modal.css');
@import url('./auth-button.css');
@import url('./legal-panel.css');
@import url('./toast.css');
@import url('./forms.css');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* === Глобальные переменные === */
:root {
}
/* Styles for the mode selector in the product detail modal */
.mode-select-btn {
  color: var(--dark-eggplant);
}

.mode-select-btn.active {
  background-color: var(--terracotta);
  color: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Weight preset buttons */
.weight-preset-btn {
  @apply px-3 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-700 transition-colors border border-transparent;
}
/* Убрана анимация hover для предотвращения подергивания */
.weight-preset-btn:active { @apply bg-gray-300; }
.weight-preset-btn.selected {
  background-color: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
}
.weight-preset-btn.nearest {
  @apply ring-2 ring-emerald-400 ring-offset-1;
}

/* Confirmation Modal specific sizing overrides (перенесено ниже @import) */
#confirmation-modal .unified-modal-container.modal-content {
  max-width: 20rem !important; /* ~320px, компактная ширина */
  width: 100%;
  max-height: 45vh !important; /* компактная высота независимо от --modal-max-height */
  overflow: visible; /* содержимое короткое, скролл не нужен */
}

/* === Active order widget === */
.active-order-section {
  background: var(--soft-peach, #fdf6f0);
}

.active-order-card {
  border-radius: 1.25rem;
  border: 1px solid rgba(230, 176, 147, 0.4);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(253, 246, 240, 0.85));
  box-shadow: 0 15px 35px rgba(143, 94, 59, 0.12);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.active-order-loading {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: activeOrderPulse 1.8s ease-in-out infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), rgba(230, 176, 147, 0.35), rgba(255, 255, 255, 0.25));
  background-size: 200% 100%;
  animation: skeletonShimmer 2s linear infinite;
}

.active-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.active-order-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--terracotta, #c26e49);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.active-order-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-eggplant, #4b0082);
}

.active-order-status-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(75, 0, 130, 0.08);
  color: var(--dark-eggplant, #4b0082);
  flex-shrink: 0;
}

.active-order-status-icon svg {
  width: 22px;
  height: 22px;
}

.active-order-summary {
  color: var(--main-text, #3c2f2f);
  font-size: 0.98rem;
  line-height: 1.35rem;
}

.active-order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
}

.active-order-meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(60, 47, 47, 0.6);
}

.active-order-meta dd {
  font-weight: 600;
  color: var(--dark-eggplant, #4b0082);
}

.active-order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.active-order-actions button {
  flex: 1 1 140px;
}

.active-order-refresh {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(75, 0, 130, 0.15);
  color: var(--dark-eggplant, #4b0082);
  background: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.active-order-refresh svg {
  width: 20px;
  height: 20px;
}

.active-order-refresh.is-rotating svg {
  animation: activeOrderSpin 0.9s linear infinite;
}

.active-order-refresh:active {
  transform: scale(0.95);
}

.active-order-error,
.active-order-empty {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.active-order-error button,
.active-order-empty button {
  align-self: flex-start;
  padding: 0.2rem 1rem;
}

.active-order-repeat {
  background: rgba(75, 0, 130, 0.08);
  color: var(--dark-eggplant, #4b0082);
  border: 1px dashed rgba(75, 0, 130, 0.3);
}

.active-order-repeat.is-loading,
#active-order-repeat-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 420px) {
  .active-order-actions button {
      flex: 1 1 100%;
  }
}

.active-order-card .hidden {
  display: none !important;
}

@keyframes activeOrderPulse {
  0% { box-shadow: 0 0 0 0 rgba(194, 110, 73, 0.2); }
  70% { box-shadow: 0 0 0 10px rgba(194, 110, 73, 0); }
  100% { box-shadow: 0 0 0 0 rgba(194, 110, 73, 0); }
}

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

@keyframes activeOrderSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === Auth avatar control === */
.auth-avatar-shell {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(244, 237, 255, 0.95), rgba(255, 234, 220, 0.95));
  border: 2px solid rgba(75, 0, 130, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.auth-avatar-shell.has-photo {
  border-color: rgba(75, 0, 130, 0.25);
}

.auth-avatar-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.08);
}

.auth-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  position: relative;
  z-index: 1;
}

.auth-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background-image: linear-gradient(145deg, #f8f1ff, #ffe8dc);
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 1;
}

.auth-avatar-placeholder::before {
  content: '';
  width: 60%;
  height: 60%;
  background-image: url("data:image/svg+xml,%3Csvg width='64' height='64' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='32' cy='22' r='14' fill='%23ccbbff'/%3E%3Cpath d='M14 56c0-9.94 8.06-18 18-18s18 8.06 18 18' fill='%23dacfff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.9;
}

.auth-avatar-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dark-eggplant, #4b0082);
  z-index: 2;
}

.auth-avatar-shell.has-photo .auth-avatar-initials {
  display: none;
}

.auth-avatar-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(75, 0, 130, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-eggplant, #4b0082);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 3;
  pointer-events: none;
}

.auth-avatar-edit svg {
  width: 12px;
  height: 12px;
}

.auth-avatar-shell:hover .auth-avatar-edit {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#auth-avatar-upload {
  display: none;
}
