/* === SECCIÓN COMPONENTES (BOTONES, CARDS, MODALES) === */

/* BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
  text-align: center;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-accent);
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 59, 0, 0.4);
}

.btn--outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn--outline:hover {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

.btn--block {
  width: 100%;
}

.btn--small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* TARJETAS DE PRODUCTO */
.product-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #444;
}

.product-card__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--color-primary);
  color: white;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: var(--radius-sm);
  z-index: 2;
  text-transform: uppercase;
}

.product-card__badge.sale {
  background-color: var(--color-success);
}

.product-card__fav {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 35px;
  height: 35px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: var(--color-muted-light);
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
}

.product-card__fav:hover,
.product-card__fav.active {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.product-card__image-container {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  background-color: #222;
  overflow: hidden;
  cursor: pointer;
}

.product-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow), opacity var(--transition-normal);
}

.product-card__image-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--transition-normal), transform var(--transition-slow);
  transform: scale(1.05);
}

.product-card:hover .product-card__image {
  opacity: 0;
}

.product-card:hover .product-card__image-hover {
  opacity: 1;
  transform: scale(1);
}

.product-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card__category {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.product-card__title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 10px;
  flex-grow: 1;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.product-card__title:hover {
  color: var(--color-primary);
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.product-card__rating i {
  color: var(--color-highlight);
}

.product-card__price-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.product-card__price {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-accent);
}

.product-card__price-old {
  font-size: 0.9rem;
  color: var(--color-muted);
  text-decoration: line-through;
}

.product-card__sizes {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
}

.product-card__size {
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--color-muted-light);
}

/* FORMULARIOS */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--color-muted-light);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-primary);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(255, 59, 0, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-error {
  color: var(--color-error);
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

.form-control.invalid {
  border-color: var(--color-error);
}

/* DRAWER DEL CARRITO */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px; /* Hidden by default */
  width: 400px;
  height: 100vh;
  background-color: var(--color-secondary);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.8);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  right: 0;
}

.cart-drawer__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cart-drawer__overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer__header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-drawer__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0;
}

.cart-drawer__close {
  font-size: 1.5rem;
  color: var(--color-muted-light);
  transition: color var(--transition-fast);
}

.cart-drawer__close:hover {
  color: var(--color-accent);
}

.cart-drawer__body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.cart-item__image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: #222;
}

.cart-item__info {
  flex-grow: 1;
}

.cart-item__title {
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.cart-item__price {
  color: var(--color-primary);
  font-weight: bold;
  margin-bottom: 10px;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  width: max-content;
  padding: 2px 5px;
}

.cart-item__qty-btn {
  color: var(--color-accent);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item__qty-btn:hover {
  color: var(--color-primary);
}

.cart-item__remove {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: 10px;
  text-decoration: underline;
}

.cart-item__remove:hover {
  color: var(--color-error);
}

.cart-empty-msg {
  text-align: center;
  color: var(--color-muted);
  margin-top: 50px;
}

.cart-drawer__footer {
  padding: 20px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.cart-drawer__subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-weight: bold;
}

.cart-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* MODAL DE PRODUCTO */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal__content {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal.open .modal__content {
  transform: translateY(0);
}

.modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
  color: var(--color-muted-light);
  z-index: 10;
  background-color: rgba(0,0,0,0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  color: var(--color-accent);
  background-color: var(--color-primary);
}

.modal__gallery {
  padding: 20px;
}

.modal__image-main {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  background-color: #222;
}

.modal__thumbnails {
  display: flex;
  gap: 10px;
}

.modal__thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  background-color: #222;
}

.modal__thumb.active, .modal__thumb:hover {
  opacity: 1;
  border-color: var(--color-primary);
}

.modal__info {
  padding: 30px 30px 30px 0;
}

.modal__title {
  margin-bottom: 10px;
}

.modal__price {
  font-size: 1.5rem;
  color: var(--color-primary);
  font-weight: bold;
  margin-bottom: 20px;
}

.modal__desc {
  font-size: 0.95rem;
  color: var(--color-muted-light);
  margin-bottom: 20px;
}

.modal__options {
  margin-bottom: 20px;
}

.modal__options-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-accent);
}

.modal__colors {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.modal__color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--color-surface);
}

.modal__color.active {
  border-color: var(--color-accent);
}

.modal__actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .cart-drawer {
    width: 100%;
    right: -100%;
  }
  
  .modal__content {
    grid-template-columns: 1fr;
  }
  
  .modal__info {
    padding: 20px;
  }
}
