:root{
  --accent:#0b6efd;
  --muted:#6b7280;
  --bg:#f6f7fb;
  --card:#ffffff;
  --radius:10px;
  --gap:18px;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Header */
.site-header{
  /* keep a subtle outer area; the actual image is on .header-inner */
  padding:18px 20px 10px;
  border-bottom:1px solid rgba(11,110,253,0.06);
}

/* inner header now supports a background image (inline url via template) */
.header-inner{
  max-width:1100px;
  margin:0 auto;
  padding:30px 22px;
  border-radius:12px;
  color:#fff;
  position:relative;
  overflow:hidden;
  box-shadow: 0 8px 26px rgba(2,6,23,0.06);
  /* background-image is provided inline from the template using url_for,
     but we provide defaults for background behavior here */
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content {
  flex: 1;
}

.header-inner .company-name{
  margin:0;
  font-size:2.25rem;
  color:#fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}
.header-inner .tagline{
  margin:6px 0 0;
  color:rgba(255,255,255,0.92);
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

/* Language Switcher */
.language-switcher {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.lang-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}


/* Grid layout */
.grid{
  max-width:1100px;
  margin:26px auto;
  padding:0 20px 80px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(100px, auto);
  gap: var(--gap);
}

/* Cards - grid placement */
.card{
  background:var(--card);
  padding:18px;
  border-radius:var(--radius);
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
}

/* Placement rules: change these to adjust layout */
.hero{ grid-column: 1 / span 8; }
.services{ grid-column: 9 / span 4; }
.team{ grid-column: 1 / span 8; }
.testimonials{ grid-column: 5 / span 4; }
.contact{ grid-column: 9 / span 4; }
.external{ grid-column: 1 / span 12; }
.order{ grid-column: 1 / span 12; }
.products{ grid-column: 1 / span 12; }
.cta{ grid-column: 7 / span 6; }

/* Responsive breakpoints */
@media (max-width: 900px){
  .grid{ grid-template-columns: repeat(6, 1fr); }
  .hero{ grid-column: 1 / -1; }
  .services{ grid-column: 1 / -1; }
  .team{ grid-column: 1 / -1; }
  .contact{ grid-column: 1 / -1; }
  .external{ grid-column: 1 / -1; }
  .cta{ grid-column: 1 / -1; }

  /* reduce header-inner padding on smaller screens */
  .header-inner{ padding:22px 16px; border-radius:10px; }
}
@media (max-width: 520px){
  .grid{ grid-template-columns: repeat(1, 1fr); gap: 12px; padding: 0 12px 60px; }
  
  /* Stack header content on mobile */
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-inner .company-name {
    font-size: 1.75rem;
  }
  
  .language-switcher {
    align-self: flex-end;
  }
}

/* Small helpers */
h2{margin:0 0 8px;font-size:1.05rem}
h3{margin:8px 0;font-size:0.95rem}
ul{margin:8px 0 0;padding-left:18px}
.muted{color:var(--muted)}
.testimonial{margin:8px 0;padding-left:12px;border-left:3px solid #eee}
.external-controls{margin-top:12px;display:flex;gap:8px}
.btn{
  display:inline-block;padding:8px 12px;background:var(--accent);color:#fff;border-radius:8px;text-decoration:none;
}
.error{color:#b91c1c}
.zen{font-style:italic;color:#0b5ed7}

/* Products section */
.products-container{
  text-align:center;
}
.item{
  margin-bottom:2rem;
}
.item img{
  max-width:100%;
  height:auto;
  border-radius:8px;
  margin:12px 0;
}

/* Footer */
.site-footer{
  text-align:center;
  padding:20px;
  border-top:1px solid rgba(11,110,253,0.06);
}
.site-footer p{
  margin:4px 0;
}

/* AI Chat Widget */
.ai-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.ai-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #0856d8 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(11, 110, 253, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(11, 110, 253, 0.5);
}

.ai-chat-toggle .close-icon {
  display: none;
}

.ai-chat-widget.open .ai-chat-toggle .chat-icon {
  display: none;
}

.ai-chat-widget.open .ai-chat-toggle .close-icon {
  display: block;
}

.ai-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat-widget.open .ai-chat-window {
  display: flex;
}

.ai-chat-header {
  background: linear-gradient(135deg, var(--accent) 0%, #0856d8 100%);
  color: white;
  padding: 16px;
  border-radius: 12px 12px 0 0;
}

.ai-chat-header h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
}

.ai-chat-subtitle {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-message,
.user-message {
  display: flex;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message {
  justify-content: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.message-content {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
}

.ai-message .message-content {
  background: white;
  color: #111827;
  border: 1px solid #e5e7eb;
}

.user-message .message-content {
  background: var(--accent);
  color: white;
}

.message-content.error {
  background: #fee;
  color: #b91c1c;
  border-color: #fca5a5;
}

.message-content p {
  margin: 0 0 8px 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.message-content li {
  margin: 4px 0;
}

.typing-indicator .message-content {
  padding: 12px 16px;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

.ai-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.ai-chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.ai-chat-input:focus {
  border-color: var(--accent);
}

.ai-chat-submit {
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ai-chat-submit:hover {
  background: #0856d8;
}

@media (max-width: 520px) {
  .ai-chat-window {
    width: calc(100vw - 40px);
    height: 450px;
    bottom: 70px;
  }
  
  .ai-chat-toggle {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
}
