@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  color: navy;
  text-decoration: none;
}

a:visited {
  color: navy;
}

body {
  font-family:'Inter', sans-serif;
  background-color: #f8f9fa;
  color: #2b2b2b;
  line-height: 1.5;
  margin: 0;
}

.header {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border-bottom: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #e5e9f2;
  column-gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left p {
  font-size: 1.4em;
  font-weight: bold;
  margin: 0;
}

/*
.header-right {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

 */

.header .logo {
  font-size: 1.2em;
  font-weight: bold;
}

.logo img {
  padding: 5px 15px;
  max-height: 80px;
  max-width: 100%;
}

.logo-link {
  text-decoration: none; /
  color: inherit;
  display: contents;
}

.logo-link:visited,
.logo-link:active,
.logo-link:hover {
  color: inherit;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 25px;
  border-radius: 8px;
  transition: 0.3s;
  padding: 8px 8px;
}

.header .nav a {
  font-size: 1em;
  margin: 0;
  text-decoration: none;
  color: #1e293b;
  font-weight: 500;
}

.header .nav a:hover {
  color: #2563eb;
}

.cart {
  display: none;
}

.burger {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 260px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 15px rgba(0,0,0,0.1);
  padding: 20px;
  transition: 0.3s;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.mobile-menu.active {
  left: 0;
}

.mobile-menu a {
  text-decoration: none;
  color: #1e293b;
  font-size: 16px;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 999;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart,
.cart-mobile {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: red;
  color: white;
  font-size: 12px;
  border-radius: 50%;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  font-weight: bold;
}

.cart-count {
  transition: 0.2s;
}

.search {
  width: 220px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.search:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 5px rgba(0, 86, 179, 0.5);
  transition: 0.2s;
}

.main {
  display: flex;
  gap: 40px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  margin-right: 20px;
  font-size: 1em;
}

.cart-box {
  background: white;
  border: 1px solid var(--border);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: 0.3s;
}

.catalog {
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
}

.catalog ul {
  list-style: none;
  padding: 0;
}

.catalog li {
  margin: 8px 0;
}

.about {
  max-width: 900px;
  margin: 0 0 20px 0;
}

.about h2 {
  font-size: 1.6em;
  margin-bottom: 15px;
}

.about p {
  font-size: 1.2em;
  line-height: 1.6;
}

.about ul {
  font-size: 1.2em;
  line-height: 1.6;
  margin-top: 10px;
}

.about li {
  margin-bottom: 5px;
}

#special-products-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  text-align: center;
  max-width: 800px;
  justify-content: flex-start;
  margin: 0 auto;
}

.special-banner {
  width: 100%;
  height: 350px;
  background-image: url("images/welding-banner.jpg");
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 40px;
}

.special-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
}

.special-banner-content {
  position: relative;
  color: white;
  text-align: center;
  max-width: 600px;
}

.special-banner h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.special-banner p {
  font-size: 18px;
  margin-bottom: 20px;
}

.banner-btn {
  background: #2563eb;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-block;
  transition: 0.3s;
}

.banner-btn:hover {
  background: #1d4ed8;
}


.content h1 {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
}

.old-price {
  text-decoration: line-through;
  color: gray;
  margin-right: 8px;
}

.available {
  color: #28a745;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  padding: 15px;
  width: 250px;
  text-align: center;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.product-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}


.product-description-text {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.catalog-preview {
  margin-top: 20px;
}

.catalog-preview h2 {
  text-align: center;
}
.catalog-grid {
  display: flex;
  gap: 20px;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.catalog-item {
  width: 250px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow);
  padding: 15px;
  transition: all 0.3s ease;
}

.catalog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.catalog-item img {
  width: 100%;
}

.catalog-item,
.product-card {
  position: relative;
}

.catalog-item a::before,
.product-card a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.catalog-item:hover,
.product-card:hover {
  cursor: pointer;
}

.footer {
  background-color: #f5f5f5;
  padding: 30px 20px;
  font-size: 0.9em;
  color: #333;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column {
  flex: 1 1 200px;
}

.footer-column h4 {
  font-size: 1.1em;
  margin-bottom: 10px;
}

.footer-column a {
  display: block;
  color: #0056b3;
  text-decoration: none;
  margin-bottom: 5px;
  transition: color 0.3s;
}

.footer-column a:hover {
  color: #003f7f;
}

.footer-bottom {
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
  font-size: 0.85em;
  color: #666;
}

#category-products-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  text-align: center;
  max-width: 800px;
  justify-content: flex-start;
  margin: 0 auto;
}

.category-header {
  height: 220px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
}

.category-header-content {
  position: relative;
  color: white;
  text-align: center;
}

.category-header h2 {
  font-size: 28px;
}


.out-of-stock {
  color: red;
}

#manufacturer-tables {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.manufacturer-block {
  flex: 1 1 calc(50% - 10px);
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.manufacturer-block h3 {
  margin-bottom: 10px;
  color: #333;
}

.manufacturer-block table {
  width: 100%;
  font-size: 14px;
}

.manufacturer-block th {
  background-color: #0056b3;
  color: white;
  padding: 8px;
  text-align: center;
}

.manufacturer-block td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.manufacturer-block td:nth-child(n + 3) {
  font-weight: bold;
  color: #28a745;
}

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2),
  0 0 10px rgba(37, 99, 235, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  animation: slideIn 0.3s ease-out forwards;
}

.toast.success {
  border-left: 6px solid #00ff88;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

.toast.hiding {
  animation: fadeOut 0.3s ease-in forwards;
}

.cart-box button, .order-button, .add-to-cart {
  font-size: 15px;
  background-color: #0056b3;
  color: white;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.2s;
}

.cart-box button:hover, .order-button:hover, .add-to-cart:hover {
  background-color: #003f88;
}

.add-to-cart:disabled {
  background-color: #a0a0a0;
  color: #ffffff;
  cursor: not-allowed;
}

.product-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 600px;
  margin: 10px auto;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#product-image {
  width: 250px;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
}

.product-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.product-info h1 {
  margin-bottom: 10px;
  font-size: 24px;
}

.product-info p {
  color: #555;
}

.product-description {
  margin-top: 20px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.price-cell {
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: 2px solid transparent;
  position: relative;
}

.price-cell:hover {
  background-color: #f0f7ff;
  color: #0056b3;
}

.price-cell.active {
  background-color: #eef3ff;
  color: #0056b3;
  border: 2px solid #0056b3;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 86, 179, 0.15);
  transform: translateY(-1px);
}

.price-cell.active::after {
  content: '✓';
  position: absolute;
  top: -2px;
  right: 2px;
  font-size: 10px;
  color: #0056b3;
}

.cart-section {
  padding: 20px;
  flex: 1;
}

.empty-state-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 20px;
}

.empty-message {
  max-width: 500px;
  width: 100%;
  padding: 40px 20px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  text-align: center;
}

.empty-message h2 {
  color: #333;
  margin-bottom: 15px;
}

.btn-back {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 25px;
  background-color: #0056b3;
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  transition: 0.3s;
}

.cart-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-outline-danger {
  background: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-danger:hover {
  background: #dc3545;
  color: white;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

#cart-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

#cart-table th {
  background-color: #f8f9fa;
  color: #333;
  text-align: left;
  padding: 15px;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
}

#cart-table td {
  padding: 15px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.out-of-stock-row {
  opacity: 0.5;
}

.cart-summary {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #fdfdfd;
  border-top: 2px solid #0056b3;
}

#cart-page-total {
  font-size: 1.2em;
  font-weight: bold;
  color: #0056b3;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.qty-btn {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
  transition: 0.2s;
}

.qty-value {
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

.qty-input {
  width: 50px;
  text-align: center;
  border: 1px solid #ddd;
  height: 25px;
  -moz-appearance: textfield; /* Прибирає стандартні стрілочки в Firefox */
}

/* Прибирає стандартні стрілочки в Chrome/Safari */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.delete-btn {
  background: none;
  border: none;
  color: #ff4d4d;
  cursor: pointer;
  font-size: 1.2em;
  transition: 0.3s;
}

#cart-table td:nth-child(7) {
  font-weight: bold;
  color: #28a745;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  display: none;
  opacity: 0;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
}

.close-modal:hover {
  color: red;
}

.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #0056b3;
  outline: none;
}

.modal-footer {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submit-order-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.submit-order-btn:hover {
  background-color: #218838;
}

@media (max-width: 768px) {

  .header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .header-right {
     display: flex;
     justify-content: flex-end;
  }

  .burger {
    display: block;
  }

  .mobile-contacts {
    padding: 15px;
    border-top: 1px solid #eee;
    margin-top: 10px;
  }

  .mobile-contacts h4 {
    margin-bottom: 10px;
    font-size: 16px;
  }

  .mobile-contacts a,
  .mobile-contacts div {
    display: block;
    margin-bottom: 8px;
    color: #333;
    text-decoration: none;
  }

  .cart {
    display: block;
   font-size: 22px;
  }

  .cart:hover {
    transform: scale(1.1);
  }


  .nav {
    display: none;
  }

  .nav.active {
    display: flex;
  }

  .main {
    display: flex;
    padding-top: 0;
    flex-direction: column;
  }

  .cart-section {
    padding-top: 0;
  }

  .catalog-grid, #special-products-container, #category-products-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
  }

.catalog-grid > *,
#special-products-container > *,
#category-products-container > * {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 10px;
}

  .catalog-grid img,
  #special-products-container img,
  #category-products-container img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
  }

  .product-card, .catalog-item {
    font-size: 14px;
  }

  .cart-container {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart-box, .catalog {
    display: none;
  }

  .active-mobile h3::after {
    transform: rotate(180deg);
  }

  .active-mobile p,
  .active-mobile a,
  .active-mobile ul {
    display: block !important;
  }

  .product-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #product-image {
    width: 100%;
    max-width: 300px;
  }

  #manufacturer-tables table,
  #manufacturer-tables tbody {
    display: block;
    width: 100%;
  }

  #manufacturer-tables thead {
    display: none;
  }

  #manufacturer-tables tr {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  }

  #manufacturer-tables td:nth-child(1),
  #manufacturer-tables td:nth-child(2) {
    width: 50%;
    margin-bottom: 15px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
  }

  #manufacturer-tables td:nth-child(3),
  #manufacturer-tables td:nth-child(4),
  #manufacturer-tables td:nth-child(5) {
    width: 33.33%;
    margin-bottom: 10px;
  }

  #manufacturer-tables td:last-child {
    width: 100%;
    margin-top: 15px;
    padding: 0;
  }

  #manufacturer-tables .add-to-cart {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 6px;
  }

  #manufacturer-tables td {
    display: flex;
    flex-direction: column;
    border: none;
    font-size: 16px;
  }

  #manufacturer-tables td::before {
    font-size: 14px;
    color: #888;
    margin-bottom: 4px;
  }

  #manufacturer-tables td:nth-child(1)::before { content: "Діаметр"; }
  #manufacturer-tables td:nth-child(2)::before { content: "Вага"; }
  #manufacturer-tables td:nth-child(3)::before { content: "Роздріб"; }
  #manufacturer-tables td:nth-child(4)::before { content: "ТОВ"; }
  #manufacturer-tables td:nth-child(5)::before { content: "Опт"; }
}
