/*
Theme Name: Cómprame Theme
Theme URI: https://comprame.co
Author: Equipo Cómprame
Author URI: https://comprame.co
Description: Tema WordPress/WooCommerce minimal y compatible con Elementor para la tienda Cómprame.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: comprame-theme
*/

:root {
  /* Nueva paleta basada en diseño Cómprame */
  --color-primary: #1B5E20;
  /* Verde oscuro - logo/iconos */
  --color-secondary: #EA580C;
  /* Naranja - acentos del logo */
  --color-accent: #22C55E;
  /* Verde brillante - botones CTA */
  --color-text: #1F2937;
  /* Gris oscuro - texto */
  --color-text-light: #6B7280;
  /* Gris claro - texto secundario */
  --color-bg: #E8F5E9;
  /* Verde muy claro - fondo principal */
  --color-bg-alt: #F0FFF4;
  /* Verde aún más claro */
  --color-white: #FFFFFF;
  --color-border: #C8E6C9;
  /* Verde claro - bordes */
  --color-dark: #111827;
  /* Oscuro - footer/botones oscuros */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset y tipografía */
*,
*::before,
*::after {
  box-sizing: border-box
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  line-height: 1.6;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s
}

a:hover {
  color: var(--color-secondary)
}

/* Header */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Footer */
.site-footer {
  background: var(--color-dark);
  color: var(--color-white);
  padding: 3rem 0 2rem;
}

.site-footer a {
  color: var(--color-bg);
  opacity: 0.9
}

.site-footer a:hover {
  opacity: 1;
  color: var(--color-accent)
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem
}

/* Botones */
.btn,
button,
input[type="submit"],
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover,
.woocommerce a.button.alt:hover {
  background: #16A34A;
  transform: translateY(-1px);
}

.btn-dark,
.woocommerce a.button,
.woocommerce button.button {
  background: var(--color-dark);
  color: var(--color-white);
}

.btn-dark:hover {
  background: #374151
}

/* Formularios */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  background: var(--color-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

/* ============================================
   SHOP PAGE LAYOUT
   ============================================ */

.shop-page {
  padding: 2rem 0;
  min-height: 60vh;
}

.shop-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ============================================
   SHOP SIDEBAR (Filtros)
   ============================================ */

.shop-sidebar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 100px;
}

.shop-sidebar__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.5rem;
  color: var(--color-text);
}

/* Filter Sections */
.filter-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-section__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-text);
}

/* Filter List (Categorías) */
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filter-list__item {
  margin-bottom: 0.5rem;
}

.filter-list__item.active .filter-list__link {
  color: var(--color-accent);
  font-weight: 600;
}

.filter-list__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.filter-list__link:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.filter-list__count {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* Rating Filter */
.filter-rating {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filter-rating__item {
  margin-bottom: 0.5rem;
}

.filter-rating__link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
  transition: opacity 0.2s;
}

.filter-rating__link:hover {
  opacity: 0.7;
}

.filter-rating__link .star {
  color: #D1D5DB;
  font-size: 1.1rem;
}

.filter-rating__link .star.filled {
  color: #F59E0B;
}

/* ============================================
   SHOP MAIN CONTENT
   ============================================ */

.shop-main {
  background: transparent;
}

/* Shop Toolbar */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.shop-toolbar__results p {
  margin: 0;
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.shop-toolbar__ordering select {
  padding: 0.5rem 2rem 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  font-size: 0.875rem;
  cursor: pointer;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.5rem !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ============================================
   PRODUCT CARD
   ============================================ */

.product-card,
ul.products li.product {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover,
ul.products li.product:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.product-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__image {
  position: relative;
  background: var(--color-bg-alt);
  aspect-ratio: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-card__image img,
ul.products li.product:hover img {
  transform: scale(1.05);
}

.product-card__badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--color-secondary);
  color: var(--color-white);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.product-card__content {
  padding: 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card__category {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-top: auto;
}

.product-card__price del {
  font-size: 0.875rem;
  color: var(--color-text-light);
  font-weight: 400;
  margin-right: 0.5rem;
}

.product-card__actions {
  padding: 0 1.25rem 1.25rem;
}

.product-card__btn {
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.product-card__btn:hover {
  background: #16A34A;
  transform: translateY(-1px);
}

/* Responsive */
@media(max-width: 1024px) {
  .shop-layout {
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
  }

  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media(max-width: 768px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
  }

  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .shop-toolbar {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .container {
    padding: 0 1rem
  }
}

@media(max-width: 480px) {
  ul.products {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================
   SINGLE PRODUCT PAGE
   ============================================ */

.single-product .summary {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

/* Product Tabs */
.woocommerce-tabs {
  margin-top: 3rem;
}

.wc-tabs {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  border-bottom: 2px solid var(--color-border);
}

.wc-tabs li {
  margin: 0;
  padding: 0;
}

.wc-tabs li a {
  display: block;
  padding: 1rem 2rem;
  color: var(--color-text-light);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s ease;
}

.wc-tabs li a:hover {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}

.wc-tabs li.active a {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  background: var(--color-bg-alt);
}

.wc-tab {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

/* Ratings & Stars */
.star-rating {
  position: relative;
  display: inline-flex;
  font-size: 1.2rem;
  color: #FCD34D !important;
  letter-spacing: 0.1em;
}

.star-rating::before {
  content: "★★★★★";
  color: #D1D5DB;
}

.star-rating span {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #F59E0B;
}

.star-rating span::before {
  content: "★★★★★";
}

/* Reviews Section */
#reviews {
  margin-top: 2rem;
}

#reviews h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

.woocommerce-Reviews {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment {
  padding: 1.5rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border-left: 3px solid var(--color-accent);
}

.comment-text {
  margin-top: 0.5rem;
}

.comment-text .star-rating {
  margin-bottom: 0.5rem;
}

/* Review Form */
#review_form_wrapper {
  background: var(--color-bg-alt);
  padding: 2rem;
  border-radius: var(--radius-lg);
}

#review_form_wrapper h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--color-text);
}

.comment-form-rating {
  margin-bottom: 1.5rem;
}

.comment-form-rating label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.stars {
  display: inline-flex;
  gap: 0.25rem;
}

.stars a {
  font-size: 1.5rem;
  color: #D1D5DB;
  text-decoration: none;
  transition: color 0.2s;
}

.stars a:hover,
.stars a.active {
  color: #F59E0B;
}

.comment-form-comment label,
.comment-form-author label,
.comment-form-email label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.comment-form-comment textarea {
  min-height: 120px;
}

.form-submit {
  margin-top: 1.5rem;
}

.form-submit .submit {
  background: var(--color-accent);
  color: var(--color-white);
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
}

.form-submit .submit:hover {
  background: #16A34A;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* No reviews message */
.woocommerce-noreviews {
  padding: 2rem;
  text-align: center;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  color: var(--color-text-light);
  font-style: italic;
}

/* Related Products */
.related.products {
  margin-top: 4rem;
}

.related.products h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}


/* ============================================
   CART PAGE
   ============================================ */

/* Wrapper Layout */
.cart-wrapper {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
}

.woocommerce-cart-form__wrapper {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

/* Cart Table */
.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  text-align: left;
}

.shop_table.cart th {
  padding: 1rem;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-border);
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.shop_table.cart td {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.shop_table.cart tr:last-child td {
  border-bottom: none;
}

/* Product Info in Cart */
.cart_item .product-thumbnail img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
}

.cart_item .product-name a {
  font-weight: 600;
  color: var(--color-text);
  font-size: 1rem;
}

.cart_item .product-name a:hover {
  color: var(--color-primary);
}

.cart_item .product-price,
.cart_item .product-subtotal {
  font-weight: 600;
  color: var(--color-text);
}

.cart_item .product-subtotal {
  color: var(--color-accent);
}

/* Remove Button */
.cart_item .product-remove .remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #EF4444;
  color: #EF4444;
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.2s;
}

.cart_item .product-remove .remove:hover {
  background: #EF4444;
  color: #fff;
}

/* Quantity Input */
.quantity input {
  width: 60px;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* Coupon & Actions */
td.actions {
  padding-top: 2rem !important;
}

.coupon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.coupon label {
  display: none;
}

.coupon .input-text {
  width: auto !important;
  min-width: 200px;
}

/* Cart Collaterals (Sidebar) */
.cart-collaterals {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 100px;
}

.cart_totals h2 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.cart_totals table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

.cart_totals th,
.cart_totals td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cart_totals tr:last-child th,
.cart_totals tr:last-child td {
  border-bottom: none;
}

.cart_totals th {
  font-weight: 600;
  text-align: left;
}

.cart_totals td {
  text-align: right;
}

.wc-proceed-to-checkout .checkout-button {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--color-accent);
  color: var(--color-white);
  text-align: center;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  font-weight: 700;
  transition: all 0.2s;
}

.wc-proceed-to-checkout .checkout-button:hover {
  background: #16A34A;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Responsive Cart */
@media (max-width: 1024px) {
  .cart-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cart-collaterals {
    position: static;
  }
}

@media (max-width: 768px) {
  .shop_table.cart thead {
    display: none;
  }

  .shop_table.cart tr {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .shop_table.cart td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border: none;
  }

  .shop_table.cart td::before {
    content: attr(data-title);
    font-weight: 600;
    margin-right: 1rem;
  }

  .shop_table.cart td.product-thumbnail,
  .shop_table.cart td.product-remove {
    justify-content: center;
  }

  .shop_table.cart td.product-thumbnail::before,
  .shop_table.cart td.product-remove::before {
    display: none;
  }

  .coupon {
    flex-direction: column;
    align-items: stretch;
  }

  .coupon .input-text {
    width: 100% !important;
  }
}