/**
 * Izar WooCommerce Elements - Frontend Styles
 */

/* ================================
   QUANTITY SELECTOR
   ================================ */
.izar-qty-wrapper {
    display: flex;
    width: 100%;
}

.izar-qty-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.izar-qty-minus,
.izar-qty-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    line-height: 1;
}

.izar-qty-minus:hover,
.izar-qty-plus:hover {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

.izar-qty-minus:active,
.izar-qty-plus:active {
    transform: scale(0.95);
}

.izar-qty-input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    -moz-appearance: textfield;
}

.izar-qty-input::-webkit-outer-spin-button,
.izar-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.izar-qty-input:focus {
    outline: none;
    border-color: #111;
}

/* ================================
   ADD TO CART BUTTON
   ================================ */
.izar-add-to-cart-wrapper {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

/* Button Width Types */
.izar-add-to-cart-wrapper.izar-btn-width-full {
    flex-direction: column;
}

.izar-add-to-cart-wrapper.izar-btn-width-full .izar-add-to-cart {
    width: 100%;
}

.izar-add-to-cart-wrapper.izar-btn-width-auto {
    flex-direction: column;
    align-items: flex-start;
}

.izar-add-to-cart-wrapper.izar-btn-width-auto .izar-add-to-cart {
    width: auto;
}

.izar-add-to-cart-wrapper.izar-btn-width-custom {
    flex-direction: column;
    align-items: flex-start;
}

.izar-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background-color: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    line-height: 1.2;
    text-decoration: none;
    box-sizing: border-box;
}

/* Reset para evitar conflictos con temas */
.izar-add-to-cart,
.izar-add-to-cart * {
    box-sizing: border-box;
}

.izar-add-to-cart:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.izar-add-to-cart:active {
    transform: translateY(0);
}

/* Loading State */
.izar-add-to-cart.izar-loading {
    pointer-events: none;
    opacity: 0.8;
}

.izar-add-to-cart.izar-loading .izar-btn-text::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: izar-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes izar-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success State */
.izar-add-to-cart.izar-added {
    background-color: #28a745;
}

/* Icon Styles */
.izar-add-to-cart .izar-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.izar-add-to-cart .izar-btn-icon i,
.izar-add-to-cart .izar-btn-icon i::before {
    font-size: inherit !important;
    width: auto;
    height: auto;
    line-height: 1;
}

.izar-add-to-cart .izar-btn-icon svg {
    fill: currentColor;
    width: 1em;
    height: 1em;
}

.izar-add-to-cart.izar-btn-icon-before .izar-btn-icon {
    margin-right: 8px;
}

.izar-add-to-cart.izar-btn-icon-after .izar-btn-icon {
    margin-left: 8px;
}

.izar-add-to-cart .izar-btn-text {
    line-height: 1.2;
}

/* View Cart Link */
.izar-view-cart-link {
    display: none;
    margin-top: 10px;
    color: #111;
    text-decoration: underline;
    font-size: 14px;
    transition: color 0.3s ease;
    width: 100%;
    text-align: center;
}

.izar-add-to-cart-wrapper.izar-btn-width-auto .izar-view-cart-link,
.izar-add-to-cart-wrapper.izar-btn-width-custom .izar-view-cart-link {
    width: auto;
    text-align: left;
}

.izar-view-cart-link:hover {
    color: #333;
}

.izar-view-cart-link.izar-visible {
    display: inline-block;
}

/* ================================
   DISCOUNT BADGE
   ================================ */
.izar-badge-wrapper {
    display: inline-block;
    line-height: 1;
}

/* Badge Base */
.izar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    box-sizing: border-box;
}

/* Formas del Badge */
.izar-badge.izar-shape-rectangle {
    border-radius: 0;
}

.izar-badge.izar-shape-rounded {
    border-radius: 20px;
}

.izar-badge.izar-shape-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 5px;
}

/* Badge Multilínea (dos líneas) */
.izar-badge.izar-badge-multiline {
    flex-direction: column;
    gap: 0;
    line-height: 1;
}

.izar-badge.izar-badge-multiline br {
    display: block;
    content: "";
    margin: 0;
}

.izar-badge .izar-badge-line1 {
    display: block !important;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.1;
}

.izar-badge .izar-badge-line2 {
    display: block !important;
    font-size: 0.65em;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* ================================
   SHORTCODE STYLES (Legacy)
   ================================ */
.izar-shortcode-qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.izar-shortcode-qty-wrap .izar-qty-minus,
.izar-shortcode-qty-wrap .izar-qty-plus {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.izar-shortcode-qty-wrap .izar-qty-input {
    width: 50px;
    height: 30px;
}

.izar-shortcode-add-to-cart {
    width: 100%;
    background: #111;
    color: white;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.izar-shortcode-add-to-cart:hover {
    background: #333;
}

.izar-shortcode-add-to-cart.izar-loading {
    opacity: 0.7;
    pointer-events: none;
}

.izar-shortcode-add-to-cart.izar-added {
    background: #28a745;
}

