/**
 * WooCommerce — estética GDA Cinema (tienda, carrito, checkout).
 */

/* ── Grid tienda: máx. 4 por fila (WC por defecto o cards GDA) ── */
#gda-main ul.products,
#gda-main .gda-products,
.gda-shop ul.products,
.woocommerce-page .woocommerce ul.products,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 1.25rem !important;
  list-style: none !important;
  margin: 0 0 2rem !important;
  padding: 0 !important;
  width: 100% !important;
  clear: both !important;
  float: none !important;
}

@media (min-width: 640px) {
  #gda-main ul.products,
  #gda-main .gda-products,
  .gda-shop ul.products,
  .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  #gda-main ul.products,
  #gda-main .gda-products,
  .gda-shop ul.products,
  .woocommerce ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

#gda-main ul.products > li,
#gda-main ul.products > li.product,
#gda-main .gda-products > li,
.woocommerce ul.products > li {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  clear: none !important;
}

/* Reset estilos WC por defecto en loop (cards .gda-product usan reglas propias abajo) */
.woocommerce ul.products li.product:not(.gda-product) a img,
.woocommerce ul.products li.product:not(.gda-product) img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 200px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  opacity: 1 !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2 {
  font-size: 0.9rem !important;
  padding: 0.75rem 0.75rem 0 !important;
  color: var(--gda-accent, #ff7a00) !important;
}

.woocommerce ul.products li.product .price {
  padding: 0 0.75rem !important;
  color: #fff !important;
  font-size: 1rem !important;
}

.woocommerce ul.products li.product .button {
  display: flex !important;
  width: calc(100% - 1.5rem) !important;
  margin: 0.5rem 0.75rem 0.75rem !important;
  justify-content: center !important;
  padding: 0.6rem 1rem !important;
  border-radius: 999px !important;
  background: var(--gda-accent, #ff7a00) !important;
  color: #000 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
}

.gda-shop--catalog .gda-shop-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
}

.gda-shop--catalog ul.products,
.gda-shop--catalog .gda-products {
  display: grid !important;
}

.gda-shop {
  padding: 1.5rem 0 3rem;
}

.gda-shop-header {
  margin-bottom: 2rem;
}

.gda-shop-intro {
  margin: 0.75rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 0, 0.35);
  background: rgba(255, 122, 0, 0.08);
  color: var(--gda-text-muted, #9b9bab);
  font-size: 0.95rem;
}

.gda-shop-intro a {
  color: var(--gda-accent, #ff7a00);
  font-weight: 600;
  margin-left: 0.35rem;
}

/* Contenido de la página Tienda (imagen, vídeo del editor) */
.gda-shop-page-content {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 26, 0.85);
}

.gda-shop-page-content img,
.gda-shop-page-content video,
.gda-shop-page-content iframe {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1rem;
  border-radius: 10px;
}

.gda-shop-page-content video {
  width: 100%;
  max-height: 420px;
}

.gda-shop-page-content iframe {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
}

.gda-shop-page-content > *:last-child {
  margin-bottom: 0;
}

/* Toolbar: resultados + ordenar */
.gda-shop .woocommerce-result-count,
.gda-shop .woocommerce-ordering {
  color: var(--gda-text-muted, #9b9bab);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.gda-shop .woocommerce-ordering select {
  background: var(--gda-bg-elevated, #12121a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--gda-text, #f0f0f5);
  padding: 0.5rem 0.75rem;
}

.gda-shop .woocommerce-before-shop-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Card producto (markup estándar WooCommerce dentro de li.gda-product) */
.gda-products > li.gda-product,
ul.products > li.gda-product {
  display: flex !important;
  flex-direction: column;
  background: rgba(18, 18, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.gda-products > li.gda-product:hover,
ul.products > li.gda-product:hover {
  border-color: rgba(255, 122, 0, 0.45);
  box-shadow: 0 0 32px rgba(255, 122, 0, 0.12);
  transform: translateY(-2px);
}

.gda-products .gda-breadcrumb,
ul.products .gda-breadcrumb {
  display: none !important;
}

.gda-products > li.gda-product .woocommerce-loop-product__link,
.gda-products > li.gda-product .gda-product__thumb-link {
  position: relative;
  display: block;
  padding: 0.75rem 0.75rem 0;
  text-align: center;
  text-decoration: none;
  background: #0f0f14;
}

.gda-products > li.gda-product .gda-product__sale,
.gda-products > li.gda-product .onsale {
  position: absolute;
  top: calc(0.75rem + 8px);
  right: calc(0.75rem + 8px);
  z-index: 2;
}

.gda-products > li.gda-product .attachment-woocommerce_thumbnail,
.gda-products > li.gda-product .attachment-gda-shop-poster,
.gda-products > li.gda-product .gda-product__img,
.gda-products > li.gda-product img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center top;
  border-radius: 10px;
  opacity: 1 !important;
}

.gda-products > li.gda-product .onsale {
  border-radius: 6px;
  background: var(--gda-accent, #ff7a00);
  color: #000;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  min-height: auto;
  line-height: 1.2;
}

.gda-products > li.gda-product .woocommerce-loop-product__title {
  margin: 0 !important;
  padding: 0.75rem 1rem 0 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--gda-accent, #ff7a00) !important;
  line-height: 1.35 !important;
}

.gda-products > li.gda-product .woocommerce-loop-product__title a {
  color: inherit !important;
  text-decoration: none !important;
}

.gda-products > li.gda-product .price {
  display: block;
  padding: 0.35rem 1rem 0.5rem !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #fff !important;
}

.gda-products > li.gda-product .price del {
  color: var(--gda-text-muted, #9b9bab);
  font-size: 0.85rem;
  margin-right: 0.35rem;
}

.gda-products > li.gda-product .price ins {
  text-decoration: none;
  color: var(--gda-accent, #ff7a00);
}

.gda-products > li.gda-product .star-rating {
  margin: 0 1rem 0.5rem;
}

.gda-products > li.gda-product .button,
.gda-products > li.gda-product a.button,
.gda-products > li.gda-product .add_to_cart_button {
  display: flex !important;
  width: calc(100% - 2rem) !important;
  margin: 0 1rem 0.75rem !important;
  justify-content: center;
  align-items: center;
  padding: 0.55rem 0.75rem !important;
  border-radius: 999px !important;
  background: var(--gda-accent, #ff7a00) !important;
  color: #000 !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  border: none !important;
  transition: background 0.2s, box-shadow 0.2s;
}

.gda-products > li.gda-product .button:hover,
.gda-products > li.gda-product a.button:hover {
  background: #ffa04d !important;
  box-shadow: 0 0 20px rgba(255, 122, 0, 0.35);
  color: #000 !important;
}

/* Ver carrito (tras añadir al carrito) */
.gda-products > li.gda-product .added_to_cart,
.gda-products > li.gda-product a.added_to_cart,
.gda-products > li.gda-product .gda-btn--view-cart {
  display: flex !important;
  width: 100%;
  justify-content: center;
  align-items: center;
  margin: 0 !important;
  padding: 0.55rem 0.75rem !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  color: var(--gda-accent, #ff7a00) !important;
  background: rgba(255, 122, 0, 0.08) !important;
  border: 1px solid rgba(255, 122, 0, 0.55) !important;
  box-shadow: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.gda-products > li.gda-product .added_to_cart:hover,
.gda-products > li.gda-product a.added_to_cart:hover,
.gda-products > li.gda-product .gda-btn--view-cart:hover {
  color: #fff !important;
  background: rgba(255, 122, 0, 0.22) !important;
  border-color: var(--gda-accent, #ff7a00) !important;
  box-shadow: 0 0 16px rgba(255, 122, 0, 0.25);
}

/* Estrellas en loop */
.gda-products > li.gda-product .star-rating {
  color: var(--gda-accent, #ff7a00);
}

/* Paginación */
.gda-shop .woocommerce-pagination {
  margin-top: 2.5rem;
}

.gda-shop .woocommerce-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
}

.gda-shop .woocommerce-pagination ul li {
  border: none;
}

.gda-shop .woocommerce-pagination ul li a,
.gda-shop .woocommerce-pagination ul li span {
  display: inline-flex;
  min-width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--gda-text-muted, #9b9bab);
  text-decoration: none;
}

.gda-shop .woocommerce-pagination ul li span.current,
.gda-shop .woocommerce-pagination ul li a:hover {
  background: var(--gda-accent, #ff7a00);
  border-color: var(--gda-accent, #ff7a00);
  color: #000;
}

/* Notices */
.gda-shop .woocommerce-message,
.gda-shop .woocommerce-info,
.gda-shop .woocommerce-error {
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid rgba(255, 122, 0, 0.3);
  border-radius: 10px;
  color: var(--gda-text, #f0f0f5);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.gda-shop .woocommerce-message::before,
.gda-shop .woocommerce-info::before,
.gda-shop .woocommerce-error::before {
  color: var(--gda-accent, #ff7a00);
}

/* Ocultar listas heredadas si algún plugin las inyecta bajo la tienda */
.gda-shop .widget_archive,
.gda-shop .widget_categories,
.gda-shop .widget_pages,
.gda-shop .widget_meta,
.gda-shop .widget_recent_entries,
.gda-shop #sidebar,
.gda-shop .woocommerce-widget-layered-nav,
.gda-shop .widget.woocommerce {
  display: none !important;
}

/* Avisos en tienda (añadido al carrito + Ver carrito) */
.gda-shop-notices {
  margin: 0 0 1.25rem;
}

.gda-shop-notices--added {
  display: block !important;
}

.gda-shop-notices--added .woocommerce-message {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.gda-shop-notices .woocommerce-message,
.gda-shop-notices .woocommerce-info,
.gda-shop-notices .woocommerce-error {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 122, 0, 0.45);
  background: rgba(18, 18, 26, 0.95);
  color: var(--gda-text, #f0f0f5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.gda-shop-notices .woocommerce-message::before {
  color: var(--gda-accent, #ff7a00);
}

.gda-shop-notices .button,
.gda-shop-notices .gda-btn--view-cart {
  margin-left: auto;
}

/* Contenido páginas WC (carrito, checkout, cuenta) */
.gda-wc-page-content {
  min-height: 200px;
}

.gda-wc-page-content .woocommerce {
  width: 100%;
}

/* Carrito / checkout básico */
.gda-shop--cart .woocommerce,
.gda-shop--checkout .woocommerce {
  color: var(--gda-text, #f0f0f5);
}

.gda-shop--cart table.shop_table {
  width: 100%;
  background: rgba(18, 18, 26, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.gda-shop--cart table.shop_table th,
.gda-shop--cart table.shop_table td {
  padding: 1rem 1.25rem;
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--gda-text, #f0f0f5);
}

.gda-shop--cart table.shop_table th {
  color: var(--gda-accent, #ff7a00);
  font-weight: 600;
}

.gda-shop--cart .cart_totals,
.gda-shop--cart .wc-proceed-to-checkout {
  margin-top: 1.5rem;
}

.gda-shop--cart .button,
.gda-shop--checkout .button,
.gda-shop--checkout #place_order {
  background: var(--gda-accent, #ff7a00) !important;
  color: #000 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  border: none !important;
}

.gda-shop--checkout input,
.gda-shop--checkout select,
.gda-shop--checkout textarea {
  background: #12121a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
}

.gda-shop--checkout input::placeholder,
.gda-shop--checkout textarea::placeholder {
  color: var(--gda-text-muted, #9b9bab);
  opacity: 1;
}

.gda-shop--checkout label {
  color: var(--gda-text-muted, #9b9bab);
}

/* Carrito vacío */
.gda-shop--cart .gda-cart-empty,
.gda-wc-page-content .gda-cart-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: rgba(18, 18, 26, 0.95);
  border: 1px solid rgba(255, 122, 0, 0.35);
  border-radius: 14px;
  box-shadow: 0 0 32px rgba(255, 122, 0, 0.08);
  margin: 1rem 0 2rem;
}

.gda-cart-empty__icon {
  margin: 0 0 0.75rem;
  font-size: 2.5rem;
  line-height: 1;
  opacity: 0.85;
}

.gda-cart-empty__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: #fff;
}

.gda-cart-empty__hint {
  color: var(--gda-text-muted, #9b9bab);
  margin: 0 auto 1.5rem;
  max-width: 28rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.gda-cart-empty__actions {
  margin: 0;
}

/* Ocultar tabla vacía si WC deja markup residual */
.gda-shop--cart .woocommerce-cart-form--empty,
.gda-shop--cart .cart-empty .wc-empty-cart-message {
  display: none;
}

.gda-shop--cart .woocommerce-notices-wrapper {
  margin-bottom: 1.5rem;
}

.gda-products > li.gda-product {
  position: relative;
}

.gda-products > li.gda-product .add_to_cart_button {
  cursor: pointer;
}

/* Formulario añadir al carrito en loop */
.gda-loop-cart-form,
.gda-loop-cart-actions {
  margin: 0;
  width: 100%;
}

.gda-loop-cart-form .button,
.gda-loop-cart-actions .button,
.gda-loop-cart-actions .ajax_add_to_cart {
  width: 100%;
}

.gda-products > li.gda-product .ajax_add_to_cart.loading {
  opacity: 0.65;
  pointer-events: none;
}
