/*
 * WooCommerce General Components Styles
 * Estilos generales de componentes de WooCommerce (breadcrumbs, ratings, botones, quantity, badges, etc.)
 * Excluye estilos específicos de: archive-product, single-product, myaccount
 */

:root {
    --drawer-width: 520px;
}

/* ========================================
   Breadcrumbs
   ======================================== */
.woocommerce-breadcrumb {
    font-size: 1em;
    font-weight: 700;
    padding: 0 3.75em !important;
}

.woocommerce-breadcrumb .breadcrumb-separator {
    padding: 0 1em;
}

.woocommerce-breadcrumb,
.woocommerce-breadcrumb a,
.product_meta a {
    text-decoration: none;
}

.woocommerce-breadcrumb a:first-of-type::before {
    content: '';
    margin-right: 0;
}

.woocommerce-breadcrumb .breadcrumb-separator::after {
    opacity: 1;
}

/* ========================================
   Star Rating
   ======================================== */
.star-rating::before {
    opacity: 1;
    color: var(--background-light);
}

.valoraciones p.stars {
    margin: 0;
}

p.stars {
    width: fit-content;
}

p.stars a::before,
p.stars:hover a::before,
p.stars a:hover~a::before,
p.stars.selected a.active~a::before {
    content: "\e020" !important;
    color: white;
    opacity: 1;
}

p.stars a,
.star-rating span,
p.stars a,
p.stars a:hover~a,
p.stars.selected a.active~a,
.star-rating span::before,
.quantity .plus,
.quantity .minus,
p.stars a:hover::after,
p.stars a::after,
.star-rating span::before,
#payment .payment_methods li input[type=radio]:first-child:checked+label::before,
p.stars span.active::before {
    color: var(--star);
}

p.stars:hover a::before,
p.stars.selected a::before {
    color: var(--star);
}

p.stars.selected a.active::before,
.wc-block-grid__product-rating .star-rating span:before,
.wc-block-grid__product-rating .wc-block-grid__product-rating__stars span:before {
    color: var(--star) !important;
}

.wc-block-grid__product-rating .star-rating:before,
.wc-block-grid__product-rating .wc-block-grid__product-rating__stars:before {
    color: var(--background-dark);
}

/* ========================================
   Buttons
   ======================================== */
.wp-element-button,
button.alt,
input[type="button"].alt,
input[type="reset"].alt,
input[type="submit"].alt,
.button.alt,
.widget-area .widget a.button.alt,
.add_to_cart_button {
    background-color: var(--vegetal);
    color: white;
    border: 2px solid var(--vegetal);
    border-radius: 0.5em;
    padding: 8px 21px 8px 21px;
    font-weight: 600;
    font-size: 1.25em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.wp-element-button.big,
.big .wp-element-button {
    padding: 0.7em 1.5em;
}

.wp-element-button:hover,
button.alt:hover,
input[type="button"].alt:hover,
input[type="reset"].alt:hover,
input[type="submit"].alt:hover,
.button.alt:hover,
.widget-area .widget a.button.alt:hover,
.add_to_cart_button:hover {
    color: white;
    background-color: var(--vegetal-dark);
    border-color: var(--vegetal);
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.widget a.button {
    border-radius: 0.5em;
}

/* ========================================
   Quantity Selector
   ======================================== */
.wc-block-components-quantity-selector {
    background: var(--background-light) !important;
    margin: 0 1em 0 0 !important;
    border-radius: 0.5em;
    border-color: transparent;
    display: inline-flex;
}

.quantity .qty {
    width: 1em !important;
    text-align: center;
    font-size: 1.5em !important;
    background: var(--background-light) !important;
    box-shadow: none;
}

.quantity .qty:hover,
.quantity .qty:focus {
    background: var(--background-light);
    border-color: var(--background-light) !important;
    outline-color: var(--background-light) !important;
}

.wc-block-components-quantity-selector:after {
    border: 0 solid transparent;
}

.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--minus {
    border-radius: 0.5em 0 0 0.5em;
}

.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button--plus {
    border-radius: 0 0.5em 0.5em 0;
}

.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button {
    background: var(--background-light);
    color: var(--front-middle);
    border-color: transparent !important;
    font-weight: bold;
    min-width: 1em;
    padding: 0.5em;
    opacity: 1;
}

.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button:hover {
    background: var(--background-middle);
}

.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button:focus,
.wc-block-components-quantity-selector>.wc-block-components-quantity-selector__button:active {
    border-color: transparent !important;
}

.wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

/* ========================================
   Product Gallery
   ======================================== */
.wc-block-product-gallery-large-image .wc-block-product-gallery-large-image__container {
    border-radius: 1.5em;
}

/* Deshabilita el click en la imagen principal del producto */
.woocommerce-product-gallery__image a {
    pointer-events: none;
    cursor: default;
}

/* ========================================
   Sale Badges
   ======================================== */
.woocommerce ul.products li.product .onsale,
.wc-block-components-product-sale-badge {
    display: none;
    top: auto;
    right: 0;
    left: 0;
    bottom: -0.5em;
    color: inherit;
    background: var(--dark-gray);
    border: 1px solid var(--dark-gray);
    border-radius: 0.5em;
    box-sizing: border-box;
    color: white;
    font-size: .5em;
    font-weight: 600;
    padding: 0.5em 0.75em;
    text-align: center;
    text-transform: uppercase;
    margin: 0.5em auto;
    min-height: auto;
    height: fit-content;
    line-height: 1;
}

.wp-block-woocommerce-product-price del,
.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
    opacity: .5;
    font-size: 0.85em;
}

.wc-block-components-product-price,
.woocommerce-variation-price .price {
    display: flex;
    gap: 0.5em;
    align-items: center;
}

.hb-sale-badge {
    background-color: var(--sixth);
    padding: 0.15em 0.5em 0.1em;
    color: white;
    font-size: 0.8em;
    border-radius: 0.3em;
    white-space: nowrap;
    font-weight: 600 !important;
}

.wc-block-components-product-price .hb-sale-badge {
    padding: 0.35em 0.6em 0.3em;
}

/* Estilo Etiqueta Black Friday */
.hb-bf-label {
    display: inline-block;
    max-width: fit-content;
    width: fit-content;
    margin: 0.5em 0;
    background-color: #393939;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Pagination
   ======================================== */
.pagination .page-numbers,
.woocommerce-pagination .page-numbers {
    margin-left: 0.25em;
}

.pagination .page-numbers li .page-numbers,
.woocommerce-pagination .page-numbers li .page-numbers {
    padding: 1em 1.5em;
    border-radius: 10px;
    margin: 0 0 0 0.5em;
}

.pagination .page-numbers li .page-numbers.current,
.woocommerce-pagination .page-numbers li .page-numbers.current {
    background-color: var(--background-middle);
    font-weight: bold;
}

/* ========================================
   Variations
   ======================================== */
.woocommerce table.variations.wpcvs-initialized tr .label {
    width: 120px;
    flex: 0 0 120px;
}

/* ========================================
   Notice Banners
   ======================================== */
.wc-block-components-notice-banner {
    align-items: center !important;
    border-radius: 3em !important;
    padding: 1em 1.75em !important;
    gap: 1em !important;
}

.wc-block-components-notice-banner>.wc-block-components-button {
    margin-top: 0 !important;
}

.wc-block-components-notice-banner.is-info {
    background-color: var(--background-middle);
    border-color: var(--background-dark);
}

.wc-block-components-notice-banner.is-info>svg {
    background-color: var(--dark-gray);
}

/* ========================================
   Mini Cart
   ======================================== */
.wc-block-mini-cart__button {
    padding: 0 0.6em;
}

.wc-block-components-drawer__screen-overlay {
    z-index: 999999999;
}

.wc-block-mini-cart__drawer {
    top: 1.75em;
    right: 1.75em;
    bottom: 1.75em;
    left: calc(100% - 1.75em);
    border-radius: 2.5em;
    height: auto;
    overflow: hidden;
}

.wp-block-woocommerce-empty-mini-cart-contents-block,
.wp-block-woocommerce-filled-mini-cart-contents-block {
    padding: 2em 1.5em 1em;
    gap: 1.5em;
}

.wc-block-mini-cart__drawer .wc-block-components-drawer__content {
    height: 100% !important;
}

.admin-bar .wc-block-components-drawer__content,
h2.wc-block-mini-cart__title {
    margin-top: 0;
}

.wc-block-components-button.wc-block-components-drawer__close {
    right: 1.75em;
    top: 1.75em;
}

.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-contents .wc-block-components-notices {
    margin-top: 0;
}

.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-contents .wc-block-components-notices .wc-block-components-notice-banner {
    margin: 0 !important;
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__items {
    padding: 0 0.7em 0 0;
    margin-right: -0.7em;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items tbody {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items tbody tr {
    padding: 1em !important;
    background-color: white;
    border-radius: 1.5em;
    box-shadow: inset 0 0 4px -1px var(--background-dark);
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__wrap>* {
    margin-bottom: 0.5em;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__wrap>*:last-child {
    margin-bottom: 0;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img {
    border-radius: 0.9em;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-price,
.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .woocommerce-variation-price .price {
    gap: 0;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata__description {
    display: none;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-metadata {
    font-size: 0.8em;
    line-height: 1.3;
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-details__name {
    color: var(--dark-gray);
}

.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity {
    align-items: center;
    flex-direction: row;
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector {
    padding: 0;
    width: 80px;
}

.wc-block-mini-cart__drawer .editor-styles-wrapper table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__prices,
.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__prices {
    line-height: 1;
    font-size: 0.85em;
}

.wc-block-mini-cart__footer {
    padding-top: 0;
}

.wc-block-mini-cart__footer {
    border-top: none;
}

/* ========================================
   Cart & Checkout Pages
   ======================================== */
.woocommerce-account .wp-block-post-title,
.woocommerce-account main .woocommerce,
.woocommerce-cart .wp-block-post-title,
.woocommerce-cart main .woocommerce,
.woocommerce-checkout .wp-block-post-title,
.woocommerce-checkout main .woocommerce {
    max-width: 100%;
}