/* Reusable Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-normal);
  text-decoration: none;
  border: 1px solid transparent;
  user-select: none;
}

.btn-primary {
  background-color: var(--color-pure-black);
  color: var(--color-white);
  border-color: var(--color-pure-black);
}

.btn-primary:hover {
  background-color: var(--color-dark-gray);
  border-color: var(--color-dark-gray);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-pure-black);
  border-color: var(--color-pure-black);
}

.btn-outline:hover {
  background-color: var(--color-pure-black);
  color: var(--color-white);
}

.btn-pill {
  border-radius: var(--border-radius-full);
  padding: 0.6rem 1.4rem;
  font-size: 0.8rem;
}

.btn-pill.active {
  background-color: var(--color-pure-black);
  color: var(--color-white);
}

.btn-danger {
  background-color: var(--color-red);
  color: var(--color-white);
}

.btn-danger:hover {
  background-color: var(--color-red-hover);
}

.btn-block {
  width: 100%;
}

/* Badges */
.badge-group {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}

.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  line-height: 1;
}

.badge-sale {
  background-color: var(--color-red);
  color: var(--color-white);
}

.badge-preorder {
  background-color: var(--color-pure-black);
  color: var(--color-white);
}

.badge-bestseller {
  background-color: #2b4c3f;
  color: var(--color-white);
}

.badge-new {
  background-color: #1a1a1a;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
}

/* Wishlist Button */
.btn-wishlist,
.product-card-wishlist-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease, background 0.2s ease;
  color: #000000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-wishlist:hover,
.product-card-wishlist-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.btn-wishlist svg,
.product-card-wishlist-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  transition: transform 0.2s ease;
}

.btn-wishlist.active,
.product-card-wishlist-btn.active {
  color: #e11d48;
  background: #ffffff;
}

.btn-wishlist.active svg,
.btn-wishlist.active svg path,
.product-card-wishlist-btn.active svg,
.product-card-wishlist-btn.active svg path {
  fill: #e11d48;
  stroke: #e11d48;
}

/* Red Rectangular Sale Tag at Top Right */
.product-card-sale-badge,
.collection-sale-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #b91c1c;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-bottom-left-radius: 2px;
  z-index: 10;
  line-height: 1;
}

/* Quick Add Hover Overlay Button */
.product-quick-add-btn,
.collection-quick-add {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 9px 0;
  border-radius: 3px;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
  z-index: 15;
}

.product-card:hover .product-quick-add-btn,
.collection-product-card:hover .product-quick-add-btn {
  opacity: 1;
  transform: translateY(0);
}

.product-quick-add-btn:hover {
  background: #ffffff;
  color: #000000;
}

/* Product Card */
.product-card,
.collection-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  cursor: pointer;
  contain: layout style;
  transition: transform var(--transition-normal);
}

.product-image-container,
.product-media-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  padding-top: 0;
  background-color: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 12px;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.product-image-container img,
.product-media-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border: none;
  outline: none;
  box-shadow: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backface-visibility: hidden;
  transform: translateZ(0);
  display: block;
}

.product-image-hover,
.product-hover-img {
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover .product-image-hover,
.product-card:hover .product-hover-img,
.collection-product-card:hover .product-image-hover,
.collection-product-card:hover .product-hover-img,
.product-image-container:hover .product-image-hover,
.product-image-container:hover .product-hover-img,
.product-media-container:hover .product-image-hover,
.product-media-container:hover .product-hover-img {
  opacity: 1 !important;
}

.product-card:hover .product-image-primary,
.product-card:hover .product-primary-img,
.product-card:hover .product-image-container img,
.product-card:hover .product-media-container img {
  transform: scale(1.03);
}

.product-card-details,
.product-meta-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px 2px 2px;
  box-sizing: border-box;
}

.product-designer-name,
.product-designer-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #71717a;
  margin-bottom: 2px;
}

.product-title-link,
.product-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
  font-size: 0.88rem;
  font-weight: 500;
  color: #111111;
  line-height: 1.35;
  margin-bottom: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.product-title-link:hover,
.product-card-title:hover {
  color: #c91c1c;
  text-decoration: underline;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-top: 2px;
}

.product-prices-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.product-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.76rem;
  line-height: 1;
  user-select: none;
  margin-left: auto;
}

.product-rating-badge .rating-score {
  font-weight: 700;
  color: #111111;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.product-rating-badge .rating-star {
  color: #10b981;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
  transform: translateY(-0.5px);
}

.product-rating-badge .rating-count {
  color: #71717a;
  font-size: 0.72rem;
  font-weight: 400;
}

.price-current {
  font-weight: 600;
  color: #111111;
}

.price-current.sale,
.price-current.sale-active {
  color: #c91c1c;
}

.price-original {
  font-size: 0.78rem;
  color: #71717a;
  text-decoration: line-through;
  font-weight: 400;
}

/* Quantity Stepper */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  height: 40px;
}

.qty-btn {
  width: 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.qty-btn:hover {
  background: var(--color-light-gray);
}

.qty-val {
  width: 40px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--color-pure-black);
  color: var(--color-white);
  padding: 14px 20px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.88rem;
  font-weight: 500;
  border-left: 4px solid var(--color-red);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Star ratings */
.star-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--color-black);
  font-size: 0.8rem;
}

.star-group svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Modal Overlay Base */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}
