/* ================= BASE ================= */

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 16px;
}

a {
  color: #111;
}

input[type=text] {
  width: 100%;
  max-width: 820px;
  padding: 12px;
  font-size: 16px;
}

button {
  padding: 10px 14px;
  font-size: 16px;
  margin-top: 8px;
  cursor: pointer;
}

/* ================= CONTAINER ================= */

.container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

.site-subtitle{
  margin-top: 6px;
  font-size: 14px;
  color: #777;
}

/* ================= LAYOUT ================= */

.row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.small {
  color: #666;
  font-size: 13px;
}

.limit-input {
  width: 90px;
  padding: 6px;
}

.page-content {
  margin-top: 10px;
}

/* ================= HEADER ================= */

.site-header {
  margin-bottom: 20px;
}

.site-title {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: #111;
}

.site-title:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.top-links {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
}

.back-link,
.new-search-link {
  text-decoration: underline;
  font-size: 14px;
  font-weight: 600;
}

.back-link:hover,
.new-search-link:hover {
  opacity: 0.85;
}

/* ================= SEARCH RESULT CARD ================= */

.item {
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;
}

.item-name {
  display: inline-block;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.2;
  color: #111;
  text-decoration: underline;
}

.item-name:hover {
  opacity: 0.9;
}

.item-meta {
  font-size: 13px;
  color: #777;
  margin-bottom: 8px;
}

.item.starred {
  opacity: 0.5;
}

/* ================= BUTTONS ================= */

.copybtn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 0 18px;
  height: 44px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.copybtn:hover {
  background: #f5f5f5;
}

.wabtn {
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  height: 44px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: 0.15s ease;
}

.wabtn:hover {
  background: #20c65a;
}

.btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}

/* убираем глобальный margin-top у кнопок в карточке */
.btns button {
  margin-top: 0;
}

/* ================= PRODUCT PAGE ================= */

.title {
  font-size: 20px;
  font-weight: 800;
  margin: 10px 0 6px;
}

.meta {
  color: #777;
  font-size: 13px;
  margin-bottom: 12px;
}

.page-label {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 12px;
}

/* ================= PRICE ================= */

.price-line {
  margin: 10px 0 16px;
  font-size: 20px;
  font-weight: 800;
}

.price-val {
  font-size: 44px;
  font-weight: 900;
}

.item-price {
  font-size: 22px;
  font-weight: 900;
  margin: 2px 0 10px;
}

/* ================= TABLE ================= */

.kv {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

.kv td {
  border-bottom: 1px solid #eee;
  padding: 10px;
  vertical-align: top;
  font-size: 14px;
}

.kv tr:last-child td {
  border-bottom: none;
}

.k {
  width: 36%;
  color: #555;
  background: #fafafa;
}

.v {
  width: 64%;
}

/* ================= SUGGESTION ================= */

.suggest-link {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f0f7ff;
  border: 1px solid #cce4ff;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.suggest-link:hover {
  background: #e4f1ff;
}

.suggest-big {
  font-size: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 800;
  line-height: 1.25;
}

/* ================= TOAST ================= */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  display: none;
  font-size: 14px;
  opacity: 0.95;
  z-index: 9999;
}

.cart-link{
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  margin-left: 20px;
}

.cart-link:hover{
  opacity: 0.8;
}

/* ================= RESPONSIVE BASE ================= */

@media (max-width: 900px){

  body{
    margin: 10px;
  }

  input[type=text]{
    max-width: 100%;
  }

}

@media (max-width: 600px){

  body{
    margin: 8px;
  }

  .row{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .limit-input{
    width: 100%;
    padding: 10px;
  }

  button{
    width: 100%;
    margin-top: 0;
  }

  .copybtn,
  .wabtn{
    width: 100%;
    justify-content: center;
  }

  .btns{
    flex-direction: column;
    align-items: stretch;
  }

  .site-title{
    font-size: 18px;
  }

  .cart-link{
    margin-left: 0;
  }

}

/* ================= CHECKOUT MODERN ================= */

.checkout-note{
  margin-bottom: 12px;
}

.checkout-form{
  width: 100%;
}

.checkout-grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.checkout-main{
  min-width: 0;
}

.checkout-side{
  min-width: 0;
}

.checkout-section{
  padding: 16px;
  margin-bottom: 16px;
}

.checkout-section-title{
  margin-top: 0;
  margin-bottom: 12px;
}

.checkout-items{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-item-card{
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.checkout-item-top{
  margin-bottom: 12px;
}

.checkout-item-name{
  display: inline-block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  color: #111;
  text-decoration: underline;
}

.checkout-item-name:hover{
  opacity: 0.9;
}

.checkout-item-sku{
  margin-top: 6px;
  font-size: 14px;
  color: #777;
}

.checkout-item-middle{
  display: grid;
  grid-template-columns: 180px minmax(220px, 320px) 180px;
  gap: 18px;
  align-items: end;
}

.checkout-price-value{
  font-size: 24px;
  font-weight: 900;
  margin-top: 4px;
}

.checkout-sum-value{
  font-size: 24px;
  font-weight: 900;
  margin-top: 4px;
}

.checkout-qty-row{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: nowrap;
}

.qty-btn{
  width: 52px;
  min-width: 52px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  flex: 0 0 52px;
  margin-top: 0;
}

.checkout-qty-input{
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  height: 44px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 18px;
  padding: 0 8px;
  flex: 0 0 80px;
}

.checkout-remove-hint{
  margin-top: 8px;
}

.checkout-fields{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-field{
  width: 100%;
}

.checkout-input{
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
}

.checkout-delivery-row{
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
}

.checkout-radio-label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkout-summary-card{
  padding: 16px;
  position: sticky;
  top: 16px;
}

.checkout-summary-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 16px;
}

.checkout-summary-actions{
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.checkout-nav-btn{
  text-decoration: none;
  justify-content: center;
  height: 44px;
}

.checkout-submit-btn{
  margin-top: 0;
  width: 100%;
  justify-content: center;
  min-height: 46px;
}

.checkout-summary-hint{
  margin-top: 10px;
}

/* ================= CHECKOUT TABLET ================= */

@media (max-width: 1100px){

  .checkout-grid{
    grid-template-columns: 1fr;
  }

  .checkout-summary-card{
    position: static;
  }

}

/* ================= CHECKOUT MOBILE ================= */

@media (max-width: 700px){

  .checkout-section{
    padding: 12px;
  }

  .checkout-item-name{
    font-size: 18px;
  }

  .checkout-item-middle{
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .checkout-price-value,
  .checkout-sum-value{
    font-size: 20px;
  }

  .checkout-qty-row{
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .qty-btn{
    width: 48px;
    min-width: 48px;
    height: 42px;
    flex: 0 0 48px;
  }

  .checkout-qty-input{
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    height: 42px;
    font-size: 17px;
    flex: 0 0 76px;
  }

  .checkout-summary-actions{
    gap: 8px;
  }

}