/* Variables de color */
:root {
    --cfc-primary-color: #4dbbbb;
    --cfc-secondary-color: #3664ab;
    --cfc-text-color: #666;
    --cfc-white-color: #fff;
}

/* Estilos para el ícono del carrito (Shortcode) */
.cfc-cart-trigger {
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: #333; /* Color del ícono */
    width: 25px;
}

.cfc-cart-count {
    position: absolute;
    top: -7px;
    right: -11px;
    background-color: var(--cfc-white-color); /* Morado */
    color: var(--cfc-primary-color);
    border-radius: 50%;
    font-size: 10px;
    line-height: 15px;
    width: 14px;
    height: 14px;
    text-align: center;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
}

/* Contenedor Principal del Carrito Flotante */
#cfc-floating-cart-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    justify-content: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s ease;
}

#cfc-floating-cart-container.is-visible {
    visibility: visible;
    opacity: 1;
}

/* Overlay */
#cfc-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Panel del Carrito */
#cfc-cart-panel {
    position: relative;
    width: 420px;
    max-width: 90%;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 25px;
}

/* Overlay de actualización dentro del carrito */
#cfc-cart-updating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#cfc-cart-updating-overlay.is-visible {
    display: flex;
}

.cfc-cart-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(72, 193, 193, 0.2);
    border-top: 5px solid #48c1c1;
    border-radius: 50%;
    animation: cfc-cart-spin 0.8s linear infinite;
}

@keyframes cfc-cart-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cfc-cart-updating-text {
    color: #48c1c1;
    font-size: 15px;
    margin-top: 15px;
    font-weight: 600;
}

#cfc-floating-cart-container.is-visible #cfc-cart-panel {
    transform: translateX(0);
}

/* Cabecera */
.cfc-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--cfc-primary-color);
}

.cfc-cart-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--cfc-primary-color);
    padding: 0px 0px 0px 115px;
    font-family: var(--trc-font-family);
    font-weight: 900;
}

.cfc-close-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.cfc-close-btn:hover {
    background: none;
    border: none;
}

.cfc-close-icon {
    width: 30px;
    height: 30px;
    display: block;
}

/* Cuerpo del carrito */
.cfc-cart-body { 
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 0;
}

/* Tabla de productos */
.cfc-cart-table {
    width: 100%;
}

.cfc-cart-table-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px 5px;
    /* background-color: #f8f8f8; */
    /* border-bottom: 1px solid #e0e0e0; */
    font-size: 16px;
    font-weight: 600;
    color: var(--cfc-text-color);
    font-family: var(--trc-font-family);
}

.cfc-header-product { text-align: center; }
.cfc-header-quantity { text-align: center; }
.cfc-header-price { text-align: center; }

/* Items del carrito */
.cfc-cart-items {
    padding: 0;
}

.cfc-cart-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    padding: 10px 5px;
    /* border-bottom: 1px solid #f0f0f0; */
    align-items: center;
}

/* Columna Producto */
.cfc-item-product {
    display: flex;
    align-items: flex-start;
}

.cfc-item-details {
    flex: 1;
    width: 100%;
}

.cfc-item-name {
    font-size: 18px;
    line-height: 22px;
    font-weight: 700;
    color: #a8d14f;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
    font-family: var(--trc-font-family-popup);
}

.cfc-item-name:hover {
    color: #8fb83f;
}

.cfc-gift-meta {
    margin-top: 4px;
}

.cfc-gift-meta small {
    font-size: 11px;
    color: #999;
    display: block;
    line-height: 1.4;
}

/* Columna Cantidad */
.cfc-item-quantity {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
}

.cfc-qty-btn {
    width: 24px;
    height: 24px;
    border: 0;
    background: white;
    color: var(--cfc-text-color);
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--trc-font-family-popup);
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cfc-qty-btn:hover,
.cfc-qty-btn:active,
.cfc-qty-btn:focus {
    background: white;
    color: var(--cfc-text-color);
}

.cfc-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cfc-qty-input {
    background: transparent !important;
    width: 40px !important;
    height: 35px !important;
    padding: 2px !important;
    text-align: center;
    border: 1px solid var(--cfc-text-color);
    border-radius: 0px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    font-family: var(--trc-font-family-popup) !important;
}

/* Cantidad fija para tarjetas de regalo */
.cfc-qty-fixed {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #333 !important;
    font-family: var(--trc-font-family-popup) !important;
}

/* Columna Precio */
.cfc-item-price {
    font-family: var(--trc-font-family-popup);
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--cfc-text-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}
.cfc-item-price bdi{
    font-size: 17px;
}

.cfc-remove-item {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cfc-remove-item:hover {
    opacity: 1;
    background: none;
    border: none;
}

.cfc-remove-icon {
    font-size: 16px;
    width: 20px;
}

/* Carrito vacío */
.cfc-empty-cart-wrapper {
    text-align: center;
    padding: 60px 20px;
}

.cfc-empty-cart {
    color: var(--cfc-text-color);
    font-size: 18px;
    font-family: var(--trc-font-family);
    font-weight: 600;
    margin-bottom: 20px;
}

.cfc-go-to-shop {
    display: inline-block;
    padding: 12px 30px;
    color: var(--cfc-secondary-color);
    text-decoration: underline;
    font-family: var(--trc-font-family);
    font-weight: 700;
    font-size: 20px;
}

/* Footer del carrito */
.cfc-cart-footer { 
    padding: 10px 5px; 
    border-top: 1px solid var(--cfc-primary-color);
    background: transparent;
}

/* Sección de cupón */
.cfc-coupon-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-left: 40px;
}

.cfc-coupon-input {
    flex: 1;
    padding: 5px 15px !important;
    border: 1px solid var(--cfc-text-color) !important;
    border-radius: 6px !important;
}

.cfc-coupon-input:focus {
    outline: none;
    border-color: #48c1c1;
}

#cfc-apply-coupon {
    background-color: var(--cfc-primary-color) !important;
    color: white !important;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;


    font-size: 18px;
    line-height: 18px;
    font-weight: 700;
    box-shadow: 1px 1px 1px 0px #666;
    border-radius: 25px 25px 25px 25px;
    padding: 12 20px 10px 20px;
}

#cfc-apply-coupon:hover {
    background-color: #3aa8a8;
}

/* Cupones aplicados */
.cfc-applied-coupons {
    margin-bottom: 15px;
}

.cfc-applied-coupon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #e8f5e9;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.cfc-coupon-name {
    font-weight: 600;
    color: #2e7d32;
}

.cfc-coupon-remove {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

/* Desglose de precios */
.cfc-price-breakdown {
    margin-top: 15px;
    padding-top: 15px;
}

/* Fila de subtotal */
.cfc-subtotal-row {
    display: flex;
    justify-content: end;
    align-items: center;
    padding: 0;
    font-size: 14px;
    color: var(--cfc-text-color);
    font-family: var(--trc-font-family-popup);
}

.cfc-subtotal-label {
    font-weight: 500;
    padding-right: 20px;
    font-family: var(--trc-font-family);
}

.cfc-subtotal-amount {
    font-weight: 600;
}

/* Sección de descuentos */
.cfc-discounts-section {
    margin: 0;
}

.cfc-discount-item {
    display: flex;
    justify-content: end;
    align-items: center;
    padding: 0;
    font-size: 14px;
}

.cfc-discount-label {
    color: #2e7d32;
    font-weight: 500;
    padding-right: 20px;
}

.cfc-discount-amount {
    color: #2e7d32;
    font-weight: 600;
}

/* Sección de total */
.cfc-total-section {
    display: flex;
    justify-content: end;
    align-items: center;
    padding: 0;
    margin-top: 10px;
    margin-bottom: 25px;
}

.cfc-total-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--cfc-primary-color);
    padding-right: 20px;
    font-family: var(--trc-font-family);
}

.cfc-total-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--cfc-text-color);
    font-family: var(--trc-font-family-popup);
}
.cfc-total-amount bdi{
    font-size: 20px;
}

/* Botón de pagar */
.cfc-actions {
    margin: 0;
    text-align: right;
}

.cfc-checkout-button {
    display: inline-block;
    background-color: var(--cfc-secondary-color);
    font-family: var(--trc-font-family);
    color: white;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, opacity 0.2s;

    font-size: 20px;
    line-height: 20px;
    font-weight: 700;
    box-shadow: 1px 1px 1px 0px #666;
    border-radius: 25px 25px 25px 25px;
    padding: 13px 30px 14px 30px;
}

.cfc-checkout-button:hover {
    background-color: var(--cfc-secondary-color);
    color: white;
}

.cfc-checkout-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

.cfc-checkout-button:disabled:hover {
    background-color: #9ca3af;
}

/* Overlay de carga */
#cfc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#cfc-loading-overlay.is-visible {
    display: flex;
}

.cfc-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid var(--cfc-primary-color);
    border-radius: 50%;
    animation: cfc-spin 0.8s linear infinite;
}

@keyframes cfc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cfc-loading-text {
    color: white;
    font-size: 16px;
    margin-top: 20px;
    font-weight: 500;
    font-family: var(--trc-font-family);
}



@media screen and (max-width: 768px) {
    .cfc-cart-header{
        padding: 10px 20px;
    }
    .cfc-cart-header h2 {
        padding: 0px 0px 0px 55px;
        font-size: 18px;
    }
    .cfc-cart-table-header{
        font-size: 14px;
        gap: 5px;
    }
    .cfc-item-name{
        font-size: 16px;
    line-height: 18px;
    }

    .cfc-coupon-section{
        padding-left: 0;
    }
}