/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

.btn-secondary:hover {
  background-color: var(--color-secondary-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
}

.btn-ghost:hover {
  background-color: var(--color-accent-light);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--fs-md);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--fs-sm);
}

/* Cards */
.card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid var(--color-border);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background-color: var(--color-secondary-light);
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: var(--space-lg);
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.card-text {
  color: var(--color-text-muted);
  font-size: var(--fs-base);
  margin-bottom: var(--space-md);
}

.card-price {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--color-accent);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-md);
}

/* Badges & Tags */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-popular { background-color: var(--color-accent); color: white; }
.badge-new { background-color: var(--color-secondary); color: var(--color-text); }
.badge-veggie { background-color: var(--color-success); color: white; }

.tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-overlay);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
  transform: translateY(20px);
  transition: transform var(--transition-spring);
}

.modal-overlay.is-open .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--color-bg-alt);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
  outline: none;
}

*:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* Accordion */
.accordion {
  border-bottom: 1px solid var(--color-border);
}

.accordion-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  color: var(--color-text);
  text-align: left;
}

.accordion-icon {
  transition: transform var(--transition-base);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.is-open .accordion-content {
  max-height: 500px;
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 1500;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 500px;
  background-color: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: all var(--transition-spring);
}

.chat-window.is-open {
  transform: scale(1);
  opacity: 1;
}

.chat-header {
  background-color: var(--color-accent);
  color: white;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.chat-message {
  max-width: 80%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
}

.chat-message.bot {
  align-self: flex-start;
  background-color: var(--color-bg-alt);
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  align-self: flex-end;
  background-color: var(--color-accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-typing {
  display: flex;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background-color: var(--color-text-muted);
  border-radius: 50%;
  animation: typing-dots 1.4s infinite ease-in-out both;
}

.chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing span:nth-child(2) { animation-delay: -0.16s; }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: 0 var(--space-md) var(--space-md);
}

.chat-suggestions .btn-sm {
  font-size: var(--fs-xs);
  border-radius: var(--radius-full);
}

.chat-input-area {
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  background: var(--color-bg);
}

.chat-input-area input {
  flex: 1;
  border: none;
  background: var(--color-bg-alt);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
}

.chat-input-area input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-accent-light);
}

.chat-input-area button {
  background: var(--color-accent);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

/* Constructor/Builder */
.constructor-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
  position: relative;
}

.constructor-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
  transform: translateY(-50%);
}

.step-indicator {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  z-index: 2;
  color: var(--color-text-muted);
}

.step-indicator.active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: white;
}

.constructor-option {
  background: var(--color-bg-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  position: relative;
}

.constructor-option:hover {
  border-color: var(--color-accent-light);
  transform: translateY(-2px);
}

.constructor-option.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.constructor-option.selected::after {
  content: '✓';
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--color-accent);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.constructor-summary {
  background: var(--color-accent-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
}

/* Banners & Cards */
.banner-warning {
  background-color: var(--color-secondary-light);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  color: var(--color-text);
  font-weight: var(--fw-bold);
}

.testimonial-card {
  background: var(--color-bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--color-secondary);
  position: absolute;
  top: 10px;
  left: 20px;
  opacity: 0.3;
}

.stat-card {
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-card .number {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-extrabold);
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

/* Keyframes */
@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); opacity: 1; }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes typing-dots {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
