﻿/* Styles specific to the gifts (Regalos) page */

/* Layout container: sidebar and product area */
.container {
  display: flex;
  min-height: 80vh;
  position: relative;
  align-items: flex-start;
}

/* Sidebar filter */
.sidebar {
  width: 220px;
  background-color: #f7f7f7;
  border-right: 1px solid #ddd;
  padding: 20px;
  position: fixed;
  top: var(--nav-offset, 120px);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar.active {
  transform: translateX(0);
}

/* Sidebar headings and buttons */

.filter-status {
  font-size: 0.85rem;
  color: #5c5c5c;
  margin: 0 0 12px;
}

.filter-btn.is-active {
  background-color: #3b2515;
  color: #fff;
}

.filter-btn.is-active:hover {
  background-color: #2a1a0f;
}

.sidebar h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar button {
  width: 100%;
  padding: 8px;
  border: none;
  background-color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.sidebar button:hover {
  background-color: #d5d5d5;
}

/* Buttons to open/close sidebar */
.toggle-sidebar,
.close-sidebar {
  background-color: #e0e0e0;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin: 10px;
}

.toggle-sidebar {
  position: fixed;
  top: var(--nav-offset, 120px);
  left: 10px;
  z-index: 101;
}

.close-sidebar {
  display: block;
  margin-left: auto;
  margin-bottom: 20px;
}

/* Product area grid */
.area-producto {
  flex: 1;
  margin-left: 0;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  gap: 32px;
  justify-content: center;
  justify-items: center;
  align-content: flex-start;
  align-items: flex-start;
  transition: margin-right 0.3s ease;
}

.sidebar.active + .area-producto {
  margin-left: 240px;
}

body.cart-open .area-producto {
  margin-right: 340px;
}

/* Card styling for each gift item */
.articulo-producto {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.articulo-producto:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.detalle-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Wrapper for the product image to allow overlay effect */
.imagen-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

/* Product images fill the wrapper proportionally */
.imagen-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay displayed on hover with "Ver detalles" text */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: bold;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Show overlay on hover */
.detalle-link:hover .overlay {
  opacity: 1;
}

/* Product name styling */
.nombre-producto {
  font-weight: 600;
  margin: 15px 0 5px;
  color: #333;
  font-size: 1rem;
  padding: 0 15px;
  text-align: center;
}

/* Product price styling */
.precio-producto {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
  text-align: center;
  padding: 0 15px;
}

.btn-add-cart {
  margin: 0 15px 15px;
  margin-top: auto;
  background-color: #242424;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-add-cart:hover {
  background-color: #000;
}

/* Cart toggle button */
.cart-toggle {
  position: fixed;
  top: var(--nav-offset, 120px);
  right: 10px;
  z-index: 102;
  background-color: #242424;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Cart panel */
.cart-panel {
  position: fixed;
  top: var(--nav-offset, 120px);
  right: 0;
  width: 320px;
  max-width: 90%;
  height: calc(100% - var(--nav-offset, 140px));
  background-color: #fff;
  box-shadow: -6px 0 18px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 101;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.cart-panel.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.cart-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #555;
}

.cart-message {
  min-height: 20px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.cart-message.is-success {
  color: #0c7a0c;
}

.cart-message.is-error {
  color: #b00020;
}

.cart-message.is-warning {
  color: #b35b00;
}

.cart-message.is-info {
  color: #1f6feb;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cart-empty {
  border: 1px dashed #ccc;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  color: #666;
}

.cart-item {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-name {
  font-weight: 600;
  color: #333;
}

.cart-item-price {
  color: #666;
  font-size: 0.9rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty-button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: #f5f5f5;
  cursor: pointer;
  font-weight: 600;
}

.cart-qty-button:hover {
  background-color: #e4e4e4;
}

.cart-qty {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.cart-remove {
  background: none;
  border: none;
  color: #b00020;
  cursor: pointer;
  font-size: 0.85rem;
}

.cart-remove:hover {
  text-decoration: underline;
}

.cart-summary {
  border-top: 1px solid #eee;
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1rem;
}

.cart-label {
  font-size: 0.85rem;
  color: #555;
}

.cart-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
}

.cart-address-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-textarea {
  min-height: 82px;
  resize: vertical;
  font-family: inherit;
}

.cart-hint {
  font-size: 0.8rem;
  color: #b35b00;
  min-height: 18px;
  margin: 0;
}

.cart-checkout {
  background-color: #635bff;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cart-checkout:hover:not(:disabled) {
  background-color: #5348ff;
}

.cart-checkout:disabled {
  background-color: #c5c5c5;
  cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .area-producto {
    margin-left: 0;
  }

  .sidebar {
    width: 70%;
  }

  body.cart-open .area-producto {
    margin-right: 0;
  }
}

@media (max-width: 650px) {
  .cart-toggle {
    right: 50%;
    transform: translateX(50%);
  }

  .cart-panel {
    width: 100%;
    max-width: 100%;
    height: calc(100% - var(--nav-offset, 140px));
  }
}

@media (min-width: 1200px) {
  body.cart-open .area-producto {
    margin-right: 380px;
  }

  .cart-panel {
    width: 360px;
  }
}


@media (max-width: 520px) {
  .area-producto {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }

  .imagen-wrapper {
    height: 140px;
  }
}
