/* ============================================================
   CENIT / RESIDENT SHOP CSS ASSET
   File: cenit-resident-shop.css
   Purpose:
   - Skin native Odoo website_sale.products without touching QWeb.
   - Keep product grid, filters, cart, pager, inherited views intact.
   - Assumes resident shell CSS is already loaded elsewhere.
============================================================ */

/* =========================
   THEME TOKENS
========================= */

:root {
  --cenit-shop-light-bg: #F5F5F7;
  --cenit-shop-light-card: #FFFFFF;
  --cenit-shop-light-text: #071527;
  --cenit-shop-light-muted: rgba(7, 21, 39, 0.62);
  --cenit-shop-light-border: rgba(15, 23, 42, 0.075);
  --cenit-shop-light-shadow:
    0 18px 38px rgba(15, 23, 42, 0.075),
    0 1px 0 rgba(255, 255, 255, 0.92) inset;

  --cenit-shop-dark-bg: #020A14;
  --cenit-shop-dark-card: #061B2F;
  --cenit-shop-dark-text: #FFFFFF;
  --cenit-shop-dark-muted: rgba(255, 255, 255, 0.68);
  --cenit-shop-dark-border: rgba(6, 135, 203, 0.48);
  --cenit-shop-dark-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.045),
    5px 8px 18px rgba(0, 0, 0, 0.18);

  /* Light mode semantic gradients: light -> dark */
  --cenit-shop-light-green: linear-gradient(90deg, #22C55E 0%, #059669 55%, #064E3B 100%);
  --cenit-shop-light-blue: linear-gradient(90deg, #0792DB 0%, #075985 52%, #02233A 100%);
  --cenit-shop-light-orange: linear-gradient(90deg, #F97316 0%, #C2410C 52%, #9A3412 100%);

  /* Dark mode semantic gradients: dark -> light */
  --cenit-shop-dark-green: linear-gradient(90deg, #064E3B 0%, #059669 55%, #22C55E 100%);
  --cenit-shop-dark-blue: linear-gradient(90deg, #02233A 0%, #075985 52%, #0792DB 100%);
  --cenit-shop-dark-orange: linear-gradient(90deg, #9A3412 0%, #C2410C 52%, #F97316 100%);
}

/* =========================
   BASE SHOP PAGE
========================= */

body:has(.o_wsale_products_page),
#wrapwrap:has(.o_wsale_products_page) {
  background: var(--cenit-shop-dark-bg) !important;
}

.o_wsale_products_page {
  min-height: 100vh !important;
  background: var(--cenit-shop-dark-bg) !important;
  color: var(--cenit-shop-dark-text) !important;
}

/* Native Odoo top shop banner/title area */
.o_wsale_products_page::before {
  content: "Tienda";
  display: block;
  width: 100%;
  margin: 0 0 26px;
  padding: 58px 18px 50px;
  color: var(--cenit-shop-dark-text);
  background: #06111F;
  text-align: center;
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.07em;
}

/* Page container */
.o_wsale_page_contained.container,
.o_wsale_page_fluid.container-fluid {
  width: min(1140px, calc(100% - 36px)) !important;
  max-width: 1140px !important;
  padding: 0 0 56px !important;
  margin: 0 auto !important;
}

.o_wsale_products_main_row {
  margin: 0 !important;
}

#products_grid {
  padding: 0 !important;
}

/* Hide empty editable website structures on live page */
.o_wsale_products_page .oe_structure.oe_empty {
  display: none !important;
}

/* =========================
   HEADER / SEARCH / FILTERS
========================= */

#o_wsale_products_header {
  margin: 0 0 18px !important;
  padding: 18px !important;
  border-radius: 24px !important;
  background: var(--cenit-shop-dark-card) !important;
  border: 1px solid var(--cenit-shop-dark-border) !important;
  box-shadow: var(--cenit-shop-dark-shadow) !important;
  color: var(--cenit-shop-dark-text) !important;
}

#o_wsale_products_header .o_wsale_shop_title,
#o_wsale_products_header .o_wsale_category_title {
  color: var(--cenit-shop-dark-text) !important;
  font-size: 1.4rem !important;
  line-height: 1.05 !important;
  font-weight: 950 !important;
  letter-spacing: -0.045em !important;
  margin: 0 !important;
}

#o_wsale_products_header .products_header {
  margin-top: 14px !important;
}

#o_wsale_products_header .o_wsale_products_header_search_form_container {
  max-width: 420px;
}

#o_wsale_products_header input,
#o_wsale_products_header .form-control,
#o_wsale_products_header select,
.o_wsale_products_page input,
.o_wsale_products_page .form-control,
.o_wsale_products_page select {
  min-height: 46px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  background: #FFFFFF !important;
  color: var(--cenit-shop-light-text) !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10) !important;
  font-weight: 760 !important;
}

.o_wsale_products_page .btn,
.o_wsale_products_page button {
  min-height: 42px;
  border-radius: 14px !important;
  font-weight: 900 !important;
}

/* Sidebar filters */
aside#products_grid_before {
  border-radius: 24px !important;
  padding: 16px !important;
  background: var(--cenit-shop-dark-card) !important;
  border: 1px solid var(--cenit-shop-dark-border) !important;
  box-shadow: var(--cenit-shop-dark-shadow) !important;
  color: var(--cenit-shop-dark-text) !important;
}

aside#products_grid_before,
aside#products_grid_before .products_categories,
aside#products_grid_before .products_attributes_filters {
  color: var(--cenit-shop-dark-text) !important;
}

aside#products_grid_before a,
aside#products_grid_before label,
aside#products_grid_before span,
aside#products_grid_before small {
  color: var(--cenit-shop-dark-muted) !important;
}

/* =========================
   PRODUCT GRID
========================= */

#o_wsale_products_grid {
  --o-wsale-products-grid-gap: 16px !important;
}

.oe_product {
  padding: 0 !important;
}

.o_wsale_product_grid_wrapper,
.oe_product_cart,
.o_wsale_product_information,
.o_wsale_product_grid_wrapper .card {
  border-radius: 24px !important;
}

.o_wsale_product_grid_wrapper {
  overflow: hidden !important;
  background: var(--cenit-shop-dark-card) !important;
  border: 1px solid rgba(6, 135, 203, 0.38) !important;
  box-shadow: var(--cenit-shop-dark-shadow) !important;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease !important;
}

.o_wsale_product_grid_wrapper:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(7, 146, 219, 0.46) !important;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 34px rgba(0, 0, 0, 0.26) !important;
}

.o_wsale_product_grid_wrapper img {
  object-fit: contain !important;
}

.o_wsale_product_information {
  padding: 14px 14px 16px !important;
}

.o_wsale_product_information_text,
.o_wsale_products_item_title,
.o_wsale_products_item_title a,
.product_price,
.oe_currency_value {
  color: var(--cenit-shop-dark-text) !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

.o_wsale_product_grid_wrapper .text-muted,
.o_wsale_product_grid_wrapper small,
.o_wsale_product_grid_wrapper p {
  color: var(--cenit-shop-dark-muted) !important;
}

/* Product buttons */
.o_wsale_product_btn,
.a-submit,
.btn-primary {
  background: var(--cenit-shop-dark-green) !important;
  color: #FFFFFF !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
}

/* Wishlist / icon buttons */
.o_wsale_product_grid_wrapper .btn-light,
.o_wsale_product_grid_wrapper .btn-outline-secondary,
.o_wsale_product_grid_wrapper .o_add_wishlist {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Ribbons / badges */
.o_ribbon,
.badge {
  border-radius: 999px !important;
  font-weight: 950 !important;
}

/* Pager */
#o_wsale_pager {
  padding-bottom: 0 !important;
}

.pagination .page-link {
  border-radius: 12px !important;
  color: var(--cenit-shop-dark-text) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.pagination .active .page-link {
  background: var(--cenit-shop-dark-blue) !important;
  color: #FFFFFF !important;
  border-color: rgba(7, 146, 219, 0.45) !important;
}

/* =========================
   LIGHT MODE
   Triggered by resident shell .theme-light if present.
   If shop is outside shell, this remains dark by default.
========================= */

.theme-light .o_wsale_products_page,
body:has(.theme-light) .o_wsale_products_page {
  background: var(--cenit-shop-light-bg) !important;
  color: var(--cenit-shop-light-text) !important;
}

.theme-light .o_wsale_products_page::before,
body:has(.theme-light) .o_wsale_products_page::before {
  background: var(--cenit-shop-light-bg) !important;
  color: var(--cenit-shop-light-text) !important;
}

.theme-light #o_wsale_products_header,
body:has(.theme-light) #o_wsale_products_header,
.theme-light .o_wsale_product_grid_wrapper,
body:has(.theme-light) .o_wsale_product_grid_wrapper,
.theme-light aside#products_grid_before,
body:has(.theme-light) aside#products_grid_before {
  background: var(--cenit-shop-light-card) !important;
  color: var(--cenit-shop-light-text) !important;
  border-color: var(--cenit-shop-light-border) !important;
  box-shadow: var(--cenit-shop-light-shadow) !important;
}

.theme-light #o_wsale_products_header .o_wsale_shop_title,
.theme-light #o_wsale_products_header .o_wsale_category_title,
.theme-light .o_wsale_product_information_text,
.theme-light .o_wsale_products_item_title,
.theme-light .o_wsale_products_item_title a,
.theme-light .product_price,
.theme-light .oe_currency_value,
body:has(.theme-light) #o_wsale_products_header .o_wsale_shop_title,
body:has(.theme-light) #o_wsale_products_header .o_wsale_category_title,
body:has(.theme-light) .o_wsale_product_information_text,
body:has(.theme-light) .o_wsale_products_item_title,
body:has(.theme-light) .o_wsale_products_item_title a,
body:has(.theme-light) .product_price,
body:has(.theme-light) .oe_currency_value {
  color: var(--cenit-shop-light-text) !important;
}

.theme-light .o_wsale_product_grid_wrapper .text-muted,
.theme-light .o_wsale_product_grid_wrapper small,
.theme-light .o_wsale_product_grid_wrapper p,
body:has(.theme-light) .o_wsale_product_grid_wrapper .text-muted,
body:has(.theme-light) .o_wsale_product_grid_wrapper small,
body:has(.theme-light) .o_wsale_product_grid_wrapper p,
.theme-light aside#products_grid_before a,
.theme-light aside#products_grid_before label,
.theme-light aside#products_grid_before span,
.theme-light aside#products_grid_before small,
body:has(.theme-light) aside#products_grid_before a,
body:has(.theme-light) aside#products_grid_before label,
body:has(.theme-light) aside#products_grid_before span,
body:has(.theme-light) aside#products_grid_before small {
  color: var(--cenit-shop-light-muted) !important;
}

.theme-light .o_wsale_product_btn,
.theme-light .a-submit,
.theme-light .btn-primary,
body:has(.theme-light) .o_wsale_product_btn,
body:has(.theme-light) .a-submit,
body:has(.theme-light) .btn-primary {
  background: var(--cenit-shop-light-green) !important;
  color: #FFFFFF !important;
}

.theme-light .o_wsale_product_grid_wrapper .btn-light,
.theme-light .o_wsale_product_grid_wrapper .btn-outline-secondary,
.theme-light .o_wsale_product_grid_wrapper .o_add_wishlist,
body:has(.theme-light) .o_wsale_product_grid_wrapper .btn-light,
body:has(.theme-light) .o_wsale_product_grid_wrapper .btn-outline-secondary,
body:has(.theme-light) .o_wsale_product_grid_wrapper .o_add_wishlist {
  background: #F3F4F6 !important;
  color: var(--cenit-shop-light-text) !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}

.theme-light .pagination .page-link,
body:has(.theme-light) .pagination .page-link {
  color: var(--cenit-shop-light-text) !important;
  background: #FFFFFF !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}

.theme-light .pagination .active .page-link,
body:has(.theme-light) .pagination .active .page-link {
  background: var(--cenit-shop-light-blue) !important;
  color: #FFFFFF !important;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 780px) {
  .o_wsale_page_contained.container,
  .o_wsale_page_fluid.container-fluid {
    width: min(100% - 28px, 680px) !important;
    padding-bottom: 108px !important;
  }

  .o_wsale_products_page::before {
    padding: 36px 14px 34px !important;
    font-size: 2.6rem !important;
  }

  #o_wsale_products_header {
    padding: 16px !important;
    border-radius: 22px !important;
  }

  #o_wsale_products_grid {
    --o-wsale-products-grid-gap: 14px !important;
  }

  .o_wsale_product_grid_wrapper,
  .oe_product_cart,
  .o_wsale_product_information,
  .o_wsale_product_grid_wrapper .card {
    border-radius: 22px !important;
  }
}
