* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  color: #34313e;
  background: #fffaf8;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

body.modal-open {
  overflow: hidden;
}

/* نوار بالای صفحه */
.announcement {
  padding: 9px 15px;
  text-align: center;
  color: #fff;
  background: #ef6b86;
  font-size: 0.92rem;
}

/* هدر */
.header {
  min-height: 82px;
  max-width: 1400px;
  margin: auto;
  padding: 15px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  color: #dd5979;
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.nav a {
  color: #45404a;
  text-decoration: none;
  font-weight: 700;
}

.nav a:hover {
  color: #e76582;
}

.cart-btn {
  border: none;
  border-radius: 30px;
  padding: 10px 17px;
  background: #ffe8ed;
  color: #be405f;
  font-weight: 700;
  white-space: nowrap;
}

.cart-btn:hover {
  background: #ffd7e1;
}

/* بنر */
.promo-banner {
  max-width: 1300px;
  margin: 18px auto 55px;
  padding: 35px;
  border-radius: 28px;
  background: #fff0f3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 35px;
}

.promo-label {
  color: #d75875;
  font-weight: 700;
}

.promo-content h1 {
  margin: 12px 0;
  color: #323047;
  font-size: clamp(1.7rem, 3vw, 2.9rem);
  line-height: 1.45;
}

.promo-content p {
  color: #66616c;
}

.promo-button {
  display: inline-block;
  margin-top: 12px;
  padding: 11px 24px;
  border-radius: 30px;
  background: #ea6984;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.promo-button:hover {
  background: #d85170;
}

.promo-visual img {
  display: block;
  width: 100%;
  max-height: 370px;
  object-fit: cover;
  border-radius: 22px;
}

/* بخش محصولات */
.products-section {
  max-width: 1300px;
  margin: 0 auto 60px;
  padding: 0 20px;
  scroll-margin-top: 20px;
}

.products-section h2 {
  margin: 0 0 25px;
  color: #343044;
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.product-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 15px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(61, 37, 47, 0.08);
}

.badge {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1;
  padding: 4px 11px;
  border-radius: 20px;
  background: #ec6b87;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-img-box {
  width: 100%;
  height: 235px;
  overflow: hidden;
  border-radius: 15px;
  background: #f8f4f5;
}

.product-img-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card h3 {
  min-height: 57px;
  margin: 15px 0 5px;
  text-align: center;
  font-size: 1.18rem;
  line-height: 1.5;
}

.product-card > .size {
  margin: 3px 0 10px;
  color: #77727a;
  text-align: center;
  font-size: 0.9rem;
}

/* کادر انتخاب سایز و رنگ برای تمام کارت‌ها */
.product-details {
  margin: 7px 0 13px;
  padding: 12px;
  border: 1px solid #f8dce4;
  border-radius: 15px;
  background: #fff2f5;
}

.detail-label {
  display: block;
  color: #45404c;
  font-size: 0.88rem;
  font-weight: 700;
}

.size-dropdown {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #e6cbd3;
  border-radius: 9px;
  background: #fff;
  color: #35313b;
}

.colors {
  margin-top: 12px;
}

.color-choices {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  margin-top: 5px;
}

.color-dot {
  display: inline-block;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid #bcb8bd;
  border-radius: 50%;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.color-dot:hover,
.color-dot:focus-visible {
  transform: scale(1.12);
}

.color-dot.active {
  border-color: #333;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px #ea6984;
  transform: scale(1.12);
}

.price {
  margin-top: auto;
  margin-bottom: 12px;
  color: #e75f7d;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
}

.add-to-cart {
  width: 100%;
  min-height: 45px;
  border: 0;
  border-radius: 24px;
  background: #eb6c87;
  color: #fff;
  font-weight: 700;
}

.add-to-cart:hover {
  background: #d95472;
}

/* نوار پیشنهاد ویژه */
.offer-strip {
  max-width: 1300px;
  margin: 5px auto 55px;
  padding: 20px;
  border-radius: 18px;
  background: #ffe6ec;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
  color: #ac3f5e;
  text-align: center;
}

/* پنجره سبد خرید */
.cart-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: rgba(25, 19, 31, 0.58);
}

.cart-modal.active {
  display: flex;
}

.cart-modal-content {
  width: min(100%, 680px);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.cart-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 22px;
  border-bottom: 1px solid #f0e5e8;
  background: #fff;
}

.cart-header h3 {
  margin: 0;
}

.close-cart {
  border: 0;
  background: transparent;
  color: #7d6870;
  font-size: 2rem;
  line-height: 1;
}

.cart-items {
  padding: 12px 20px;
}

.empty-cart {
  padding: 30px 10px;
  text-align: center;
  color: #777;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid #f1e7e9;
}

.cart-item > img {
  width: 75px;
  height: 75px;
  flex: 0 0 75px;
  border-radius: 10px;
  background: #faf5f6;
  object-fit: contain;
}

.item-info {
  min-width: 0;
  flex: 1;
}

.item-info h5 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.item-variant {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  color: #666;
  font-size: 0.83rem;
}

.item-variant > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cart-color-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid #aaa;
  border-radius: 50%;
}

.item-price {
  display: block;
  margin-top: 5px;
  color: #dd5d7b;
  font-weight: 700;
  font-size: 0.92rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.qty-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #ffe3e9;
  color: #b94060;
  font-weight: 700;
}

.checkout-section {
  padding: 5px 20px 22px;
}

.cart-summary {
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 12px;
  background: #fff4f6;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 5px 0;
}

.total-row {
  margin-top: 7px;
  padding-top: 12px;
  border-top: 1px solid #edcfd8;
  color: #bc405f;
  font-weight: 800;
}

.order-form h4 {
  margin: 0 0 12px;
}

.form-group {
  margin-bottom: 11px;
}

.order-form input,
.order-form textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ded5d9;
  border-radius: 9px;
  background: #fff;
  color: #333;
}

.order-form textarea {
  resize: vertical;
}

.order-form input:focus,
.order-form textarea:focus,
.size-dropdown:focus {
  outline: 2px solid #ee9caf;
  outline-offset: 1px;
}

.pay-btn {
  width: 100%;
  min-height: 47px;
  border: 0;
  border-radius: 10px;
  background: #e86682;
  color: #fff;
  font-weight: 800;
}

.pay-btn:hover {
  background: #d65371;
}

.pay-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* پیام کوتاه و دکمه بالا */
.toast-alert {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  max-width: calc(100% - 40px);
  padding: 12px 17px;
  border-radius: 12px;
  background: #35303e;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.back-to-top {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 100;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: #ee7290;
  box-shadow: 0 6px 16px rgba(189, 65, 95, 0.22);
  font-size: 1.5rem;
}

/* موبایل و صفحه‌های کوچک */
@media (max-width: 800px) {
  .header {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 10px 17px;
  }

  .promo-banner {
    margin: 15px 15px 40px;
    grid-template-columns: 1fr;
    padding: 23px;
  }

  .promo-visual img {
    max-height: 300px;
  }

  .offer-strip {
    margin-right: 15px;
    margin-left: 15px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }

  .product-card {
    padding: 11px;
  }

  .product-img-box {
    height: 190px;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .qty-controls {
    margin-right: auto;
  }

  .cart-header,
  .cart-items,
  .checkout-section {
    padding-right: 14px;
    padding-left: 14px;
  }
}
