/* main.css - единый файл стилей для публичной части LabaPrint */

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

:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --secondary: #6c757d;
  --success: #198754;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #212529;
  --border: #dee2e6;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: #f5f5f7;
  color: var(--dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: 0;
  padding-bottom: 0;
}

/* Для десктопа - отступ под фиксированный app-bar */
@media (min-width: 768px) {
  body {
    padding-top: 70px;
  }
}

/* Для мобильных - отступ под нижнюю навигацию */
@media (max-width: 767px) {
  body {
    padding-bottom: 70px;
  }
}


/* Специфичные для страниц */
.cart-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contacts-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Chat Section */
.chat-section {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 24px 24px 24px 8px;
  font-size: 15px;
  background: #ffffff;  /* Белый фон */
  color: var(--dark);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);  /* Лёгкая тень для объёма */
}

/* Messages Area */
.messages-area {
  background-color: #e8f0fe;
  background-image: radial-gradient(#c5d5ea 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 20px 20px 4px 20px;  /* верх 20, низ 8, лево 20, право 20 */
  /* border-bottom: 1px solid #dee2e6; */
  min-height: 150px;
  overflow-y: auto;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

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

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

/* Avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bot-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767px) {
  .avatar {
    width: 32px;
    height: 32px;
  }
}



/* Catalog Section */
.catalog-section {
  flex: 1;
  background-color: #e8f0fe;
  background-image: radial-gradient(#c5d5ea 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
  min-height: 150px;
  overflow-y: auto;
}

.catalog-header {
  /* margin-bottom: 20px; */
  /* padding-bottom: 12px; */
  /* border-bottom: 1px solid var(--border); */
  position: sticky;
  top: 0;
  background-color: #e8f0fe;
  background-image: radial-gradient(#c5d5ea 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 0px 20px 12px 20px;  /* верхний отступ уменьшен с 20px до 0px */
  z-index: 5;
}

.catalog-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Product Card */
.product-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

/* Product Image */
.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

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

@media (max-width: 767px) {
  .product-image {
    border-radius: 10px;
  }
}

/* Стили для спецификаций товара */
/* Product Specs */
.product-specs {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.product-specs li {
  padding: 4px 0;
  font-size: 12px;
  color: var(--secondary);
  position: relative;
  padding-left: 16px;
  line-height: 1.0;   /* ← интерлиньяж (1.4 = 140% от размера шрифта) */
}

.product-specs li:before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--primary);
  font-weight: bold;
}

@media (max-width: 767px) {
  .product-specs li {
    font-size: 10px;
    padding: 3px 0 3px 14px;
  }
  .product-specs li:before {
    left: 2px;
  }
}

.product-title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 15px;
}

.product-desc {
  font-size: 12px;
  color: var(--secondary);
  margin: 8px 0;
  flex: 1;
}

.product-price {
  font-weight: 600;
  color: var(--primary);
  margin-top: 8px;
  font-size: 14px;
}

/* Add to Cart Button */
.add-to-cart-btn {
  border: none;
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 12px;
  width: 100%;
  transition: all 0.2s;
  font-family: inherit;
}

.add-to-cart-btn:hover {
  transform: translateY(-1px);
}

.add-to-cart-btn.product-btn {
  background: var(--success);
  color: white;
}

.add-to-cart-btn.product-btn:hover {
  background: #146c43;
}

.add-to-cart-btn.service-btn {
  background: var(--primary);
  color: white;
}

.add-to-cart-btn.service-btn:hover {
  background: var(--primary-dark);
}

/* Cart Badge */
.cart-badge {
  background: #dc3545;
  color: white;
  border-radius: 30px;
  font-weight: bold;
  text-align: center;
  z-index: 10;
}

@media (min-width: 768px) {
  .cart-badge {
    position: static;
    margin-left: 4px;
    display: inline-block;
    padding: 2px 7px;
    font-size: 11px;
    min-width: 20px;
  }
}

@media (max-width: 767px) {
  .cart-badge {
    position: absolute;
    top: -4px;
    right: 4px;
    padding: 2px 5px;
    font-size: 9px;
    min-width: 16px;
  }
}

/* Cart Page */
.cart-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.cart-items {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item:hover {
  background: var(--light);
}

.cart-item-info {
  display: flex;
  align-items: center;
  flex: 2;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f7;
  margin-right: 12px;
  flex-shrink: 0;
}

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

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.item-price {
  color: var(--secondary);
  font-size: 13px;
}

.item-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--light);
  padding: 4px 12px;
  border-radius: 40px;
}

.quantity-btn {
  background: white;
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.quantity-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quantity-num {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.item-total {
  font-weight: 700;
  color: var(--dark);
  min-width: 80px;
  text-align: right;
}

.delete-item {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  color: var(--secondary);
}

.delete-item:hover {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger);
  transform: scale(1.1);
}

.cart-summary {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 16px;
}

.total-row {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 20px;
  font-weight: 800;
  font-size: 20px;
  color: var(--dark);
}

.checkout-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 40px;
  font-size: 17px;
  font-weight: 600;
  margin-top: 24px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.empty-cart {
  text-align: center;
  padding: 48px 24px;
  background: white;
  border-radius: var(--radius);
}

.empty-cart-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-cart h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-cart p {
  color: var(--secondary);
  margin-bottom: 24px;
}

.continue-shopping {
  display: inline-block;
  padding: 12px 32px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 40px;
  font-weight: 600;
  transition: all 0.2s;
}

.continue-shopping:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Contacts Page */
.contacts-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.contacts-card {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.contacts-header {
  text-align: center;
  margin-bottom: 32px;
}

.contacts-header h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.contacts-header p {
  color: var(--secondary);
}

.contact-info {
  margin: 32px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius);
  transition: background 0.2s;
  cursor: pointer;
}

.contact-item:hover {
  background: var(--light);
}

.contact-icon {
  width: 56px;
  height: 56px;
  background: var(--light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.contact-details {
  flex: 1;
}

.contact-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--secondary);
  margin-bottom: 4px;
}

.contact-value {
  font-size: 17px;
  font-weight: 500;
  color: var(--dark);
}

.contact-value a {
  color: var(--primary);
  text-decoration: none;
}

.work-hours {
  background: var(--light);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 24px 0;
}

.work-hours strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.map-placeholder {
  background: linear-gradient(135deg, var(--light), var(--border));
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin: 24px 0;
  color: var(--secondary);
}

.legal-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.legal-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 40px;
  transition: all 0.2s;
}

.legal-link:hover {
  background: var(--light);
}

/* Notification */
.cart-notification {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success);
  color: white;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
}

.cart-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (min-width: 768px) {
  .cart-notification {
    bottom: 30px;
  }
}

@media (max-width: 767px) {
  .cart-notification {
    bottom: 80px;
    font-size: 12px;
    padding: 10px 20px;
    white-space: nowrap;
  }
}

/* Адаптация для мобильных */
@media (max-width: 767px) {
  .main-content {
    padding: 12px;
    padding-bottom: 80px;
  }
  
  .messages-area {
    padding: 16px;
  }
  
  .catalog-section {
    padding: 0 16px 16px 16px;
	background-size: 20px 20px;
  }
  
  .catalog-header h2 {
    font-size: 16px;
  }
  
  .products-grid {
    gap: 12px;
  }
  
  .product-card {
    padding: 12px;
  }
  
  .product-title {
    font-size: 13px;
  }
  
  .product-desc {
    font-size: 10px;
  }
  
  .product-price {
    font-size: 12px;
  }
  
  .add-to-cart-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .bubble {
    max-width: 85%;
    font-size: 14px;
  }
  
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .cart-item-info {
    width: 100%;
  }
  
  .item-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .cart-item-image {
    width: 50px;
    height: 50px;
  }
  
  .contacts-card {
    padding: 24px;
  }
  
  .contact-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  .contact-value {
    font-size: 15px;
  }
}

/* Scrollbar */
.catalog-section::-webkit-scrollbar,
.messages-area::-webkit-scrollbar,
.cart-container::-webkit-scrollbar,
.contacts-container::-webkit-scrollbar {
  width: 6px;
}

.catalog-section::-webkit-scrollbar-track,
.messages-area::-webkit-scrollbar-track,
.cart-container::-webkit-scrollbar-track,
.contacts-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.catalog-section::-webkit-scrollbar-thumb,
.messages-area::-webkit-scrollbar-thumb,
.cart-container::-webkit-scrollbar-thumb,
.contacts-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.catalog-section::-webkit-scrollbar-thumb:hover,
.messages-area::-webkit-scrollbar-thumb:hover,
.cart-container::-webkit-scrollbar-thumb:hover,
.contacts-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 16px;
}

/* Direct Form (обращение к руководителю) */
.direct-form {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.direct-form h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.direct-form .subtitle {
  color: var(--secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.direct-form .form-group {
  margin-bottom: 20px;
}

.direct-form .form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--dark);
}

.direct-form .form-group label span {
  color: var(--danger);
}

.direct-form .form-group input,
.direct-form .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
}

.direct-form .form-group input:focus,
.direct-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.direct-form .form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.direct-submit-btn {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.direct-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Form Notification */
.form-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--success);
  color: white;
  padding: 14px 28px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  pointer-events: none;
}

.form-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.form-notification.error {
  background: var(--danger);
}

@media (max-width: 767px) {
  .direct-form {
    padding: 20px;
  }
  
  .direct-form h3 {
    font-size: 18px;
  }
  
  .direct-form .form-group input,
  .direct-form .form-group textarea {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .direct-submit-btn {
    padding: 12px 20px;
    font-size: 15px;
  }
  
  .form-notification {
    bottom: 80px;
    font-size: 12px;
    padding: 10px 20px;
    white-space: nowrap;
  }
}

/* Футер собственности */
.policy-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
}

.policy-footer a {
    color: #0d6efd;
    text-decoration: none;
}

.policy-footer a:hover {
    text-decoration: underline;
}