/* Corso x Corso Theme Styles */

:root {
  --font-primary: "Stack Sans Headline", sans-serif;
  --font-heading: "Stack Sans Headline", sans-serif;
  --custom-width-and-height: 3rem;
}

body {
  font-family: var(--font-primary);
  color: var(--foreground);
  background: var(--primary-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

html {
  overscroll-behavior: none;
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}

.container-fluid {
  max-width: 1440px;
}

/* Heading styles */
h1,
h2,
h3,
h4,
h5,
h6,
.product_title,
.woocommerce-loop-product__title,
.product-title {
  font-family: var(--font-heading) !important;
}

/* Global button styles */

input[type="submit"],
input[type="button"],
.single_add_to_cart_button,
.checkout-button,
.woocommerce-button {
  border-radius: 40px !important;
  padding: 0.75rem 2rem !important;
  font-family: var(--font-primary) !important;
  border: 1px solid var(--foreground) !important;
  background: transparent !important;
  color: var(--foreground) !important;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

input[type="submit"]:hover,
input[type="button"]:hover,
.single_add_to_cart_button:hover,
.checkout-button:hover,
.woocommerce-button:hover {
  background: var(--foreground) !important;
  color: var(--background) !important;
}

button:not(.cx-theme-switcher):not(.btn-link):disabled,
.button:disabled,
.btn:not(.btn-link):disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Header & navigation to mimic Next layout */
.cx-header {
  position: fixed;
  z-index: 99;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: .33rem 3.75rem;
  background: var(--background);
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--custom-width-and-height);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Solo en front-page se permite el estado root con logo grande */
body.home .cx-header.root {
  padding: 3rem 3.75rem;
  background: transparent;
  height: auto;
}

.cx-header.shrink {
  padding: .33rem 3.75rem;
  background: var(--background);
  height: var(--custom-width-and-height);
}

.cx-header .cx-logo svg {
  width: 180px;
  height: 38px;
  margin-top: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Solo en front-page se permite el logo grande */
body.home .cx-header.root .cx-logo svg {
  width: auto;
  height: 75px;
  margin-top: 20px;
}

.cx-header.shrink .cx-logo svg {
  width: 180px;
  height: 38px;
  margin-top: 0;
}

.cx-header .cx-logo-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.cx-header .cx-menu-icon {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  position: absolute;
  right: 1rem;
}

.cx-nav-left,
.cx-nav-right {
  position: fixed;
  z-index: 99;
  width: 100vh;
  padding: .5rem var(--custom-width-and-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--custom-width-and-height);
  min-width: 33rem;
  user-select: none;
  background: var(--background);
}

.cx-nav-left {
  transform: rotate(-90deg);
  bottom: 0;
  left: var(--custom-width-and-height);
  transform-origin: bottom left;
}

.cx-nav-right {
  transform: rotate(90deg);
  top: 0;
  left: 100vw;
  transform-origin: top left;
}

.cx-nav-left .menu,
.cx-nav-right .menu {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cx-nav-left .menu li,
.cx-nav-right .menu li {
  list-style: none;
}

.cx-nav-left .menu a,
.cx-nav-right .menu a {
  text-decoration: none;
}

.cx-cart {
  transform: rotate(-90deg);
  position: relative;
  display: inline-block;
}

.cx-cart-icon {
  position: relative;
  display: inline-block;
  font-size: 1.5rem;
}

.cx-cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}

.cx-theme-switcher,
.cx-theme-switcher-mobile,
.cx-theme-switcher:focus {
  color: inherit;
  text-decoration: none;
  border: none;
  background-color: transparent;
  outline: 0 !important;
}

.cx-theme-switcher,
.cx-theme-switcher:focus {
  transform: rotate(90deg);
}


/* Hide theme toggle icons based on aria-hidden value */
[data-theme-toggle] .dark[aria-hidden="true"],
[data-theme-toggle] .light[aria-hidden="true"] {
  display: none !important;
}

/* Cart bounce animation */
.cx-cart-icon.animate {
  animation: bounce 0.3s ease;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.cx-nav-mobile {
  position: fixed;
  z-index: 99;
  top: 0;
  width: 100%;
  display: none;
  gap: 1rem;
  justify-content: space-between;
  padding: 3rem;
  background: var(--background);
}

.cx-nav-mobile.open {
  display: flex;
  flex-direction: column;
}

.cx-nav-mobile .menu {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cx-nav-mobile .menu li {
  list-style: none;
}

.cx-nav-mobile .menu a {
  text-decoration: none;
}

main.site-content {
  padding: var(--custom-width-and-height) var(--custom-width-and-height) 0;
  min-height: calc(100vh - var(--custom-width-and-height));
}

body.home main.site-content {
  padding: 150px calc(20px + var(--custom-width-and-height)) 0;
}

footer.site-footer {
  background: var(--background);
  height: var(--custom-width-and-height);
  padding: 0 var(--custom-width-and-height);
}

footer.site-footer .container-fluid {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}

/* Swup page transition (fade) */
.transition-fade {
  transition: opacity .4s ease;
}

html.is-animating .transition-fade {
  opacity: 0.05;
}


/* Product grid (Woo outputs ul.products > li.product) */
ul.products {
  list-style: none;
  padding: 0;
  margin: 0 -0.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

ul.products::before,
ul.products::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 1200px) {
  ul.products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  ul.products {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

ul.products li.product {
  margin: 0 !important;
  padding: 0.25rem;
  width: 100% !important;
  float: none !important;
}

ul.products li.product .woocommerce-LoopProduct-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Hover image container to mirror Next HoverImage.module.css */
.image-container {
  width: 100%;
  position: relative;
  padding-bottom: 100%;
  background: #111;
  overflow: hidden;
}

.image-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease-in-out;
  opacity: 1;
  border: solid 2px var(--foreground);
}

.image-container img.hover-image {
  opacity: 0;
}

.image-container:hover img.hover-image {
  opacity: 1;
}

.product-card {
  text-align: left;
}

.product-card .product-title {
  margin: 0.25rem 0 0;
  font-size: 1rem;
}

.product-card .price {
  font-size: 0.95rem;
  color: #333;
}

/* WooCommerce price color */
.woocommerce:where(body:not(.woocommerce-uses-block-theme)) ul.products li.product .price {
  color: var(--foreground) !important;
}

/* Category nav for shop */
.shop-categories {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0 0 1rem 0;
  list-style: none;
  justify-content: center;
}

.shop-categories a {
  text-decoration: none;
  color: var(--foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
}

.shop-categories a.active {
  background: var(--foreground);
  color: var(--background);
}

/* Hide shop page title */
.woocommerce-products-header__title {
  display: none !important;
}

/* Hide result count and ordering */
.woocommerce-result-count,
.woocommerce-ordering {
  display: none !important;
}

/* Footer */
footer {
  font-size: 0.9rem;
}

/* Single product page styles (mirror Next layout) */
.single-product-container {
  padding: 0 !important;
  margin: 0 !important;
}

.single-product-container .row {
  margin: 0;
}

.single-product-container .col-md-6 {
  padding: 0;
}

.single-product-container .cx-sticky {
  position: sticky;
  top: 50px;
  height: 100vh;
  overflow-y: auto;
}

.single-product-container .woocommerce-breadcrumb,
.single-product-container .woocommerce-breadcrumb a{
  font-size: .875rem;
  margin-bottom: 1rem;
  opacity: .8;
  color: var(--foreground);
}

.single-product-container h1.product_title {
  margin-top: 2rem;
  margin-bottom: .5rem;
  font-size: 2rem;
}

.single-product-container .woocommerce-product-details__short-description {
  display: none !important;
}

.single-product-container .woocommerce-product-details__full-description {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.single-product-container .woocommerce-product-details__full-description p {
  margin-bottom: 1rem;
}

/* Price and cart form in same line */
.single-product-container .summary .price {
  font-weight: 600;
  margin: 0 !important;
  font-size: 1.25rem;
  display: inline-block;
  vertical-align: middle;
}

.single-product-container .summary form.cart {
  margin: 0 !important;
  display: inline-block;
  vertical-align: middle;
  margin-left: 1rem !important;
}

.single-product-container .quantity {
  display: none !important;
}

.single-product-container button.single_add_to_cart_button {
  border-radius: 40px;
  padding: 0.75rem 2rem;
  margin: 0;
}

.single-product-container .product_meta {
  display: none !important;
}

/* Hide ratings */
.single-product-container .woocommerce-product-rating {
  display: none !important;
}

/* Hide tabs section since description is shown above */
.single-product-container .woocommerce-tabs {
  display: none !important;
}

/* Related products - images only in horizontal layout */
.single-product-container .related.products {
  margin-top: 3rem;
}

.single-product-container .related.products h2 {
  display: none !important;
}

.single-product-container .related.products ul.products {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}

.single-product-container .related.products ul.products li.product {
  flex: 0 0 25%;
  padding: 0;
  margin: 0;
}

.single-product-container .related.products .product .woocommerce-loop-product__title {
  display: block !important;
  padding: 0.5rem 1rem;
  margin: 0;
  font-size: 0.9rem;
}

.single-product-container .related.products .product .price,
.single-product-container .related.products .product .button {
  display: none !important;
}

.single-product-container .related.products .product a {
  pointer-events: auto;
}

/* Custom gallery - vertical scroll like Next.js */
.single-product-container .cx-product-gallery {
  background: var(--background);
  padding: 0;
  overflow-y: auto;
  max-height: none;
}

.single-product-container .woocommerce-product-gallery {
  width: 100%;
  opacity: 1 !important;
  display: block !important;
}

.single-product-container .woocommerce-product-gallery.woocommerce-product-gallery--columns-4,
.single-product-container .woocommerce-product-gallery.woocommerce-product-gallery--columns-3,
.single-product-container .woocommerce-product-gallery.woocommerce-product-gallery--columns-2 {
  columns: 1 !important;
}

/* Override WooCommerce default gallery width */
.single-product-container div.images {
  float: none !important;
  width: 100% !important;
  margin-bottom: 0 !important;
}

.single-product-container div.summary {
  float: none !important;
  width: 100% !important;
  clear: none !important;
}

/* Remove FlexSlider wrapper styles */
.single-product-container .woocommerce-product-gallery .flex-viewport {
  height: auto !important;
  overflow: visible !important;
  position: static !important;
}

.single-product-container .woocommerce-product-gallery__wrapper {
  width: 100% !important;
  display: block !important;
  transform: none !important;
  transition: none !important;
}

/* Stack images vertically - full width */
.single-product-container .woocommerce-product-gallery__image {
  width: 100% !important;
  float: none !important;
  display: block !important;
  margin: 0 !important;
  position: relative !important;
  overflow: hidden;
}

.single-product-container .woocommerce-product-gallery__image a {
  display: block;
  width: 100%;
  pointer-events: none;
}

.single-product-container .woocommerce-product-gallery__image img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  object-fit: cover;
  max-width: 100%;
}

/* Remove zoom image overlay */
.single-product-container .woocommerce-product-gallery__image img.zoomImg {
  display: none !important;
}

/* Hide thumbnail navigation and zoom trigger */
.single-product-container .flex-control-thumbs,
.single-product-container .woocommerce-product-gallery__trigger {
  display: none !important;
}


/* Responsive header like Next */
@media (max-width: 768px) {
  main.site-content {
    padding-top: 50px;
  }

  .cx-header {
    padding: .5rem 1rem;
    height: 50px;
  }

  .cx-header .cx-logo svg {
    width: 120px;
    height: 25px;
    max-width: 100%;
  }

  .cx-nav-left,
  .cx-nav-right,
  .cx-cart {
    display: none;
  }



  .cx-header .cx-menu-icon {
    display: block;
    position: fixed;
    z-index: 100;
    top: 0;
    right: 1rem;
  }

  /* Single product on mobile */
  .single-product-container .cx-sticky {
    position: static;
    top: auto;
    height: auto;
  }

  .single-product-container .woocommerce-product-gallery__image img {
    height: auto;
    max-height: 50vh;
  }

  .single-product-container h1.product_title {
    margin-top: 1rem;
    font-size: 1.5rem;
  }

  /* Horizontal scroll for images on mobile */
  .single-product-container .woocommerce-product-gallery__wrapper {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .single-product-container .woocommerce-product-gallery__image {
    flex: 0 0 100% !important;
    scroll-snap-align: start;
  }

  .single-product-container .woocommerce-product-gallery__wrapper::-webkit-scrollbar {
    display: none;
  }

  /* Related products stacked vertically on mobile */
  .single-product-container .related.products ul.products {
    flex-direction: column;
  }

  .single-product-container .related.products ul.products li.product {
    flex: 0 0 100% !important;
  }
}

/* Single Post layout: left sticky content, right gallery */
body.single-post .cx-post-sticky {
  position: sticky;
  top: 100px;
  /* offset below fixed header */
}

body.single-post .cx-post-gallery img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 991.98px) {
  body.single-post .cx-post-sticky {
    position: static;
    top: auto;
  }
}

/* Prevent gallery duplication on left content column */
body.single-post .cx-post-sticky .wp-block-gallery,
body.single-post .cx-post-sticky .blocks-gallery-grid,
body.single-post .cx-post-sticky .gallery {
  display: none !important;
}

.wp-block-gallery.wp-block-gallery-1 {
  gap: 0 !important;
}

/* Unified Button Overrides: primary background, pill shape, secondary border */
.wp-element-button,
.wp-block-button__link,
input[type="submit"],
input[type="button"],
.btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.single_add_to_cart_button,
.add_to_cart_button,
.checkout-button,
.woocommerce-button {
  background: var(--light_fg) !important;
  color: var(--light_bg) !important;
  border: 2px solid var(--foreground) !important;
  border-radius: 9999px !important;
  padding: 0.75rem 2rem !important;
  font-family: var(--font-primary) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.single_add_to_cart_button:hover,
.add_to_cart_button:hover,
.checkout-button:hover,
.woocommerce-button:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.wp-element-button:active,
.wp-block-button__link:active,
button:active,
input[type="submit"]:active,
input[type="button"]:active,
.button:active,
.woocommerce a.button:active,
.woocommerce button.button:active,
.woocommerce input.button:active,
.woocommerce #respond input#submit:active,
.single_add_to_cart_button:active,
.add_to_cart_button:active,
.checkout-button:active,
.woocommerce-button:active {
  transform: translateY(0);
  filter: brightness(0.93);
}

.wp-element-button:focus,
.wp-block-button__link:focus,
button:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
.button:focus,
.woocommerce a.button:focus,
.woocommerce button.button:focus,
.woocommerce input.button:focus,
.woocommerce #respond input#submit:focus,
.single_add_to_cart_button:focus,
.add_to_cart_button:focus,
.checkout-button:focus,
.woocommerce-button:focus {
  outline: 2px solid var(--secondary) !important;
  outline-offset: 2px !important;
}

/* Disabled state */
button[disabled],
input[type="submit"][disabled],
input[type="button"][disabled],
.button.disabled,
.woocommerce a.button.disabled,
.woocommerce button.button:disabled,
.woocommerce input.button:disabled,
.woocommerce #respond input#submit:disabled {
  opacity: .5 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}