/* Shop / cart / checkout styles for product.html */

.product_filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.product_filter {
  padding: 10px 22px;
  border-radius: 30px;
  border: 2px solid #eadcc6;
  background: #fff;
  color: #5c5c5c;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .3s ease-in-out, background .3s ease-in-out, color .3s ease-in-out, transform .2s ease-in-out;
}

.product_filter:hover {
  border-color: #a3b18a;
  color: #2f3e2e;
  transform: translateY(-2px);
}

.product_filter.is-active {
  background: #2f3e2e;
  border-color: #2f3e2e;
  color: #fff;
}

.product_grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product_card {
    animation: none !important;
  }
}

@media (max-width: 1199px) {
  .product_grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
  .product_grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479px) {
  .product_grid { grid-template-columns: 1fr; }
}

.product_card {
  position: relative;
  background: #fff;
  border: 1px solid #eadcc6;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  animation: cardIn .6s ease both;
  transition: box-shadow .3s ease-in-out, transform .3s ease-in-out, border-color .3s ease-in-out;
}

.product_card:hover {
  box-shadow: 0 12px 30px rgba(47, 62, 46, .12);
  transform: translateY(-6px);
  border-color: #a3b18a;
}

.product_card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: rgba(47, 62, 46, .85);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 5px 10px;
  border-radius: 20px;
}

.product_card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #f7f5f0;
}

.product_card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease-in-out;
}

.product_card:hover .product_card-media img {
  transform: scale(1.08);
}

.product_card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product_card-name {
  font-size: 18px;
  font-weight: 600;
  color: #2f3e2e;
  margin-bottom: 6px;
}

.product_card-desc {
  font-size: 14px;
  color: #5c5c5c;
  margin-bottom: 14px;
  flex: 1;
}

.product_card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product_card-price {
  font-size: 18px;
  font-weight: 600;
  color: #c2a878;
}

.product_card-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 30px;
  background: #2f3e2e;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .3s ease-in-out;
}

.product_card-add:hover { background: #a3b18a; }

.product_card-add.is-added { background: #a3b18a; }

/* Floating cart trigger */

.cart_trigger {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #2f3e2e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 25px rgba(47, 62, 46, .35);
  z-index: 998;
  cursor: pointer;
}

.cart_trigger:hover { background: #a3b18a; }

@keyframes cartBump {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); }
  55% { transform: scale(.94); }
  100% { transform: scale(1); }
}

.cart_trigger.is-bumping { animation: cartBump .5s ease-in-out; }

.cart_trigger-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 50%;
  background: #c2a878;
  color: #2f3e2e;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cart drawer */

.cart_overlay,
.checkout_overlay {
  position: fixed;
  inset: 0;
  background: rgba(47, 62, 46, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease-in-out, visibility .3s ease-in-out;
  z-index: 999;
}

.cart_overlay.is-open,
.checkout_overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cart_drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 420px;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s ease-in-out;
  z-index: 1000;
}

.cart_drawer.is-open { transform: translateX(0); }

.cart_drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid #eadcc6;
}

.cart_drawer-header h3 {
  color: #2f3e2e;
  font-size: 20px;
}

.cart_close {
  font-size: 26px;
  line-height: 1;
  color: #2f3e2e;
  cursor: pointer;
}

.cart_drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.cart_empty {
  color: #5c5c5c;
  text-align: center;
  margin-top: 40px;
}

.cart_item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f7f5f0;
}

.cart_item-media {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f7f5f0;
}

.cart_item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart_item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart_item-name {
  font-size: 15px;
  font-weight: 600;
  color: #2f3e2e;
}

.cart_item-price {
  font-size: 13px;
  color: #5c5c5c;
}

.cart_item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.cart_item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart_item-qty button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #eadcc6;
  color: #2f3e2e;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart_item-qty button:hover { background: #eadcc6; }

.cart_item-remove {
  font-size: 12px;
  color: #c2a878;
  text-decoration: underline;
  cursor: pointer;
}

.cart_item-linetotal {
  font-size: 14px;
  font-weight: 600;
  color: #2f3e2e;
}

.cart_drawer-footer {
  padding: 20px 24px 26px;
  border-top: 1px solid #eadcc6;
}

.cart_total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  color: #2f3e2e;
  margin-bottom: 14px;
}

.cart_buy {
  width: 100%;
  justify-content: center;
  padding: 14px;
  border-radius: 30px;
  background: #c2a878;
  color: #2f3e2e;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.cart_buy:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.cart_buy:not(:disabled):hover { background: #2f3e2e; color: #fff; }

/* Checkout modal */

.checkout_modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease-in-out, visibility .3s ease-in-out;
  z-index: 1001;
}

.checkout_modal.is-open {
  opacity: 1;
  visibility: visible;
}

.checkout_modal-inner {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 32px 30px;
}

.checkout_modal-inner h3 {
  color: #2f3e2e;
  font-size: 22px;
  margin-bottom: 16px;
}

.checkout_modal .cart_close {
  position: absolute;
  top: 16px;
  right: 20px;
}

.checkout_summary-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #a3b18a;
  font-weight: 700;
  margin-bottom: 8px;
}

.checkout_summary {
  border: 1px solid #eadcc6;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  max-height: 140px;
  overflow-y: auto;
}

.checkout_summary li {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #5c5c5c;
  padding: 6px 0;
}

.checkout_summary li + li { border-top: 1px dashed #f7f5f0; }

.checkout_total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: #2f3e2e;
  font-size: 17px;
  margin-bottom: 20px;
}

.form_group { margin-bottom: 16px; }

.form_group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2f3e2e;
  margin-bottom: 6px;
}

.form_group input,
.form_group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #eadcc6;
  border-radius: 8px;
  font-size: 14px;
  color: #2f3e2e;
  background: #f7f5f0;
}

.form_group input:focus,
.form_group textarea:focus {
  border-color: #a3b18a;
}

.checkout_status {
  font-size: 14px;
  min-height: 20px;
  margin-bottom: 10px;
}

.checkout_status.is-error { color: #c2a878; }
.checkout_status.is-success { color: #a3b18a; }

.checkout_submit {
  width: 100%;
  justify-content: center;
  padding: 14px;
  border-radius: 30px;
  background: #2f3e2e;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.checkout_submit:hover { background: #a3b18a; }
.checkout_submit:disabled { background: #ccc; cursor: not-allowed; }

html.fixed .cart_drawer,
html.fixed .checkout_modal { z-index: 1200; }

html.fixed .product_modal { z-index: 1000006; }
html.fixed .product_modal-overlay { z-index: 1000005; }

/* "View product" hint on card image */

.product_card-view {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 12px);
  padding: 8px 18px;
  border-radius: 30px;
  background: rgba(255, 255, 255, .92);
  color: #2f3e2e;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease-in-out, transform .3s ease-in-out;
}

.product_card:hover .product_card-view,
.product_card:focus-visible .product_card-view {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Product detail popup */

.product_modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(47, 62, 46, .6);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease-in-out, visibility .3s ease-in-out;
  /* Above the header (110000) and the float button (1000000) so the popup and
     its close button are never buried. Stays under .intro-popup (1000010). */
  z-index: 1000005;
}

.product_modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.product_modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease-in-out, visibility .3s ease-in-out;
  z-index: 1000006;
}

.product_modal.is-open {
  opacity: 1;
  visibility: visible;
}

.product_modal-inner {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  transform: translateY(18px);
  transition: transform .35s ease-in-out;
}

.product_modal.is-open .product_modal-inner { transform: none; }

.product_modal .cart_close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product_modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product_modal-media {
  background: #f7f5f0;
  border-radius: 16px 0 0 16px;
  overflow: hidden;
}

.product_modal-media img {
  width: 100%;
  height: 100%;
  max-height: 90vh;
  object-fit: cover;
  display: block;
}

.product_modal-info {
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
}

.product_modal-tag {
  align-self: flex-start;
  background: #eadcc6;
  color: #2f3e2e;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.product_modal-name {
  font-size: 24px;
  font-weight: 600;
  color: #2f3e2e;
  margin-bottom: 10px;
}

.product_modal-desc {
  font-size: 15px;
  color: #5c5c5c;
  margin-bottom: 18px;
}

.product_modal-specs {
  border: 1px solid #eadcc6;
  border-radius: 10px;
  padding: 6px 14px;
  margin-bottom: 22px;
}

.product_modal-specs li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: #5c5c5c;
  padding: 8px 0;
}

.product_modal-specs li + li { border-top: 1px dashed #f0ece3; }

.product_modal-specs li span:last-child {
  color: #2f3e2e;
  font-weight: 600;
  text-align: right;
}

.product_modal-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.product_modal-price {
  font-size: 24px;
  font-weight: 700;
  color: #c2a878;
}

@media (max-width: 767px) {
  .product_modal-content { grid-template-columns: 1fr; }

  .product_modal-media {
    border-radius: 16px 16px 0 0;
    aspect-ratio: 4 / 3;
  }

  .product_modal-media img { max-height: none; }

  .product_modal-info { padding: 24px 22px 28px; }

  .product_modal-name { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .product_modal-inner,
  .product_card-view { transition: none; }
}
