/**
 * Checkout Core CSS - Meloopets
 * Estilos base del formulario de checkout
 * @version 2.0.0
 */

/* ========================================
   VARIABLES Y RESET
   ======================================== */

.meloopets-checkout.checkout-page {
    --checkout-primary: #4A7356;
    --checkout-primary-hover: #3a5d44;
    --checkout-secondary: #F4BE0C;
    --checkout-accent: #f26722;
    --checkout-accent-dark: #e55a1f;
    --checkout-white: #FFFFFF;
    --checkout-text: #3F2C21;
    --checkout-text-light: #6c757d;
    --checkout-gray-100: #f8f9fa;
    --checkout-gray-200: #e9ecef;
    --checkout-border: #e9ecef;
    --checkout-radius: 12px;
    --checkout-shadow: 0 2px 8px rgba(74, 115, 86, 0.08);
    --checkout-shadow-hover: 0 4px 16px rgba(74, 115, 86, 0.12);
    --checkout-transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ocultar hero section */
.meloopets-checkout.checkout-page .hero-section,
.meloopets-checkout.checkout-page .entry-header {
    display: none !important;
}

.meloopets-checkout.checkout-page .entry-content {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* ========================================
   OCULTAR WOOCOMMERCE NOTICES
   ======================================== */

/* Ocultar todas las notificaciones de WooCommerce en checkout */
.meloopets-checkout.checkout-page .woocommerce-notices-wrapper,
.meloopets-checkout.checkout-page .woocommerce-message,
.meloopets-checkout.checkout-page .woocommerce-info,
.meloopets-checkout.checkout-page .woocommerce-error,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-notices-wrapper,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-message,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-info,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-error {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   LAYOUT PRINCIPAL - ESPECÍFICO CHECKOUT
   ======================================== */

.meloopets-checkout.checkout-page .woocommerce-checkout,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-checkout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .meloopets-checkout.checkout-page .woocommerce-checkout,
    .meloopets-checkout .meloopets-checkout-wrapper .woocommerce-checkout {
        grid-template-columns: 1fr 480px;
        align-items: start;
        gap: 2.5rem;
    }
}

.meloopets-checkout.checkout-page .ct-customer-details,
.meloopets-checkout .meloopets-checkout-wrapper .ct-customer-details {
    background: var(--checkout-white);
    border-radius: var(--checkout-radius);
    box-shadow: var(--checkout-shadow);
    padding: 2rem;
    transition: box-shadow var(--checkout-transition);
}

.meloopets-checkout.checkout-page .ct-customer-details:hover,
.meloopets-checkout .meloopets-checkout-wrapper .ct-customer-details:hover {
    box-shadow: var(--checkout-shadow-hover);
}

.meloopets-checkout.checkout-page .ct-order-review,
.meloopets-checkout .meloopets-checkout-wrapper .ct-order-review {
    background: var(--checkout-gray-100);
    border-radius: var(--checkout-radius);
    padding: 2rem;
    position: static;
}

/* ========================================
   TÍTULOS Y HEADERS - ESPECÍFICO CHECKOUT
   ======================================== */

.meloopets-checkout.checkout-page .ct-order-review h3,
.meloopets-checkout.checkout-page .woocommerce-billing-fields h3,
.meloopets-checkout.checkout-page .woocommerce-shipping-fields h3,
.meloopets-checkout.checkout-page .woocommerce-additional-fields h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--checkout-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--checkout-primary);
    position: relative;
}

.meloopets-checkout.checkout-page .ct-order-review h3::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--checkout-primary);
    border-radius: 3px;
}

.meloopets-checkout.checkout-page #order_review_heading,
.meloopets-checkout .meloopets-checkout-wrapper #order_review_heading {
    font-size: 1.25rem;
    color: var(--checkout-text);
    border-bottom: 2px solid var(--checkout-border);
    margin-bottom: 1.5rem;
}

/* ========================================
   CUSTOMER DETAILS - ESPECÍFICO CHECKOUT
   ======================================== */

/* Contenedor col2-set dentro de ct-customer-details (solo checkout) */
.meloopets-checkout-wrapper .ct-customer-details > .col2-set,
.meloopets-checkout.checkout-page .ct-customer-details > .col2-set {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Solo afectar columnas hijas directas de col2-set dentro de ct-customer-details */
.meloopets-checkout-wrapper .ct-customer-details > .col2-set > .col-1,
.meloopets-checkout-wrapper .ct-customer-details > .col2-set > .col-2,
.meloopets-checkout.checkout-page .ct-customer-details > .col2-set > .col-1,
.meloopets-checkout.checkout-page .ct-customer-details > .col2-set > .col-2 {
    width: 100%;
}

.meloopets-checkout-wrapper .ct-customer-details > .col2-set > .col-2,
.meloopets-checkout.checkout-page .ct-customer-details > .col2-set > .col-2 {
    padding-top: 2rem;
    border-top: 2px dashed var(--checkout-border);
}

/* Checkbox de envío diferente */
.meloopets-checkout.checkout-page #ship-to-different-address,
.meloopets-checkout .meloopets-checkout-wrapper #ship-to-different-address {
    background: linear-gradient(135deg, #4A7356 0%, #3a5d44 100%);
    padding: 1rem 1.5rem;
    border-radius: var(--checkout-radius);
    margin-bottom: 1.5rem;
    border: none;
}

.meloopets-checkout.checkout-page #ship-to-different-address label,
.meloopets-checkout .meloopets-checkout-wrapper #ship-to-different-address label {
    color: var(--checkout-white);
    font-weight: 500;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.meloopets-checkout.checkout-page #ship-to-different-address-checkbox,
.meloopets-checkout .meloopets-checkout-wrapper #ship-to-different-address-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--checkout-secondary);
}

.meloopets-checkout.checkout-page .woocommerce-billing-fields__field-wrapper,
.meloopets-checkout.checkout-page .woocommerce-shipping-fields__field-wrapper,
.meloopets-checkout.checkout-page .woocommerce-additional-fields__field-wrapper,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-billing-fields__field-wrapper,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-shipping-fields__field-wrapper,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-additional-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Grid de 2 columnas más ancho en desktop */
@media (min-width: 768px) {
    .meloopets-checkout.checkout-page .woocommerce-billing-fields__field-wrapper,
    .meloopets-checkout.checkout-page .woocommerce-shipping-fields__field-wrapper,
    .meloopets-checkout .meloopets-checkout-wrapper .woocommerce-billing-fields__field-wrapper,
    .meloopets-checkout .meloopets-checkout-wrapper .woocommerce-shipping-fields__field-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Forzar que los form-row ocupen su espacio completo */
    .meloopets-checkout.checkout-page .woocommerce-billing-fields__field-wrapper .form-row,
    .meloopets-checkout.checkout-page .woocommerce-shipping-fields__field-wrapper .form-row,
    .meloopets-checkout .meloopets-checkout-wrapper .woocommerce-billing-fields__field-wrapper .form-row,
    .meloopets-checkout .meloopets-checkout-wrapper .woocommerce-shipping-fields__field-wrapper .form-row {
        width: 100% !important;
        float: none !important;
        clear: none !important;
        margin: 0 !important;
    }
}

/* ========================================
   ORDER REVIEW - TABLA ESPECÍFICA DEL CHECKOUT
   ======================================== */

/* Solo afectar a la tabla de revisión de orden en checkout */
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--checkout-white);
    border-radius: var(--checkout-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.meloopets-checkout .woocommerce-checkout-review-order-table thead,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table thead {
    background: var(--checkout-text);
}

.meloopets-checkout .woocommerce-checkout-review-order-table thead th,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table thead th {
    color: var(--checkout-white);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meloopets-checkout .woocommerce-checkout-review-order-table tbody tr,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tbody tr {
    border-bottom: 1px solid var(--checkout-border);
    transition: background-color 0.2s ease;
}

.meloopets-checkout .woocommerce-checkout-review-order-table tbody tr:hover,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tbody tr:hover {
    background-color: var(--checkout-gray-100);
}

.meloopets-checkout .woocommerce-checkout-review-order-table td,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table td {
    padding: 1rem;
    vertical-align: middle;
}

.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tbody .product-name {
    font-weight: 500;
    color: var(--checkout-text);
}

.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table .product-quantity {
    color: var(--checkout-primary);
    font-size: 0.9rem;
}

.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tbody .product-total {
    text-align: right;
    font-weight: 500;
    font-size: 1.1rem;
}

.meloopets-checkout .woocommerce-checkout-review-order-table tfoot th,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tfoot th {
    padding: 1rem;
    font-weight: 600;
    color: var(--checkout-text);
    background: var(--checkout-gray-200);
}


.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tfoot td {
    padding: 1rem;
    text-align: left;
    background: var(--checkout-gray-200);
}

.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tfoot .order-total th,
.meloopets-checkout.checkout-page .shop_table.woocommerce-checkout-review-order-table tfoot .order-total td {
    background: var(--checkout-secondary);
    color: var(--checkout-text);
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1.25rem 1rem;
}

/* Envío - Específico para checkout */
.meloopets-checkout .ct-shipping-heading,
.meloopets-checkout.checkout-page #order_review .ct-shipping-heading {
    font-weight: 600;
    color: var(--checkout-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.meloopets-checkout .woocommerce-shipping-methods,
.meloopets-checkout.checkout-page #order_review .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.meloopets-checkout .woocommerce-shipping-methods li,
.meloopets-checkout.checkout-page #order_review .woocommerce-shipping-methods li {
    padding: 0.75rem 1rem;
    background: var(--checkout-white);
    border: 2px solid var(--checkout-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.meloopets-checkout .woocommerce-shipping-methods li:hover,
.meloopets-checkout.checkout-page #order_review .woocommerce-shipping-methods li:hover {
    border-color: var(--checkout-primary);
    background: var(--checkout-gray-100);
}

.meloopets-checkout .woocommerce-shipping-methods label,
.meloopets-checkout.checkout-page #order_review .woocommerce-shipping-methods label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

/* ========================================
   PAYMENT METHODS - ESPECÍFICO CHECKOUT
   ======================================== */

/* Ocultar payment section según solicitud */
.meloopets-checkout.checkout-page .wc_payment_methods,
.meloopets-checkout .meloopets-checkout-wrapper .wc_payment_methods {
    display: none !important;
}

.meloopets-checkout.checkout-page #payment,
.meloopets-checkout .meloopets-checkout-wrapper #payment {
    padding: 1.5rem;
    /*margin-top: 1.5rem;*/
}

.meloopets-checkout.checkout-page .wc_payment_methods,
.meloopets-checkout .meloopets-checkout-wrapper .wc_payment_methods {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.meloopets-checkout.checkout-page .wc_payment_method,
.meloopets-checkout .meloopets-checkout-wrapper .wc_payment_method {
    border: 2px solid var(--checkout-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.meloopets-checkout.checkout-page .wc_payment_method:hover,
.meloopets-checkout .meloopets-checkout-wrapper .wc_payment_method:hover {
    border-color: var(--checkout-primary);
    box-shadow: 0 2px 8px rgba(74, 115, 86, 0.1);
}

.meloopets-checkout.checkout-page .wc_payment_method > label,
.meloopets-checkout .meloopets-checkout-wrapper .wc_payment_method > label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

.meloopets-checkout.checkout-page .wc_payment_method img,
.meloopets-checkout .meloopets-checkout-wrapper .wc_payment_method img {
    max-height: 40px;
    width: auto;
}

.meloopets-checkout.checkout-page .payment_box,
.meloopets-checkout .meloopets-checkout-wrapper .payment_box {
    padding: 1rem 1.25rem;
    background: var(--checkout-gray-100);
    border-top: 1px solid var(--checkout-border);
    color: var(--checkout-text-light);
    font-size: 0.9rem;
}

/* ========================================
   BOTONES - ESPECÍFICO CHECKOUT
   ======================================== */


.meloopets-checkout .meloopets-checkout-wrapper .place-order {
    margin-top: 0;
}

.meloopets-checkout.checkout-page #place_order,
.meloopets-checkout .meloopets-checkout-wrapper #place_order {
    width: 100%;
    background: linear-gradient(135deg, #f26722 0%, #e55a1f 100%);
    color: var(--checkout-white);
    border: none;
    padding: 1.25rem 2rem;
    border-radius: var(--checkout-radius);
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(242, 103, 34, 0.3);
}

.meloopets-checkout.checkout-page #place_order:hover,
.meloopets-checkout .meloopets-checkout-wrapper #place_order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 103, 34, 0.4);
}

.meloopets-checkout.checkout-page #place_order:active,
.meloopets-checkout .meloopets-checkout-wrapper #place_order:active {
    transform: translateY(0);
}

/* ========================================
   TÉRMINOS Y CONDICIONES
   ======================================== */
   
.meloopets-checkout .meloopets-checkout-wrapper .meloopets-custom-terms-text {
    padding: 1.5rem;
    background: var(--checkout-white);
    border-radius: var(--checkout-radius);
    border-left: 4px solid var(--checkout-primary);
    box-shadow: 0 4px 12px rgba(74, 115, 86, 0.12), 
                0 8px 24px rgba(0, 0, 0, 0.06);
}

.meloopets-checkout .meloopets-checkout-wrapper .meloopets-custom-terms-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--checkout-text);
}

.meloopets-checkout .meloopets-checkout-wrapper .meloopets-custom-terms-text a {
    color: var(--checkout-primary);
    font-weight: 600;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.meloopets-checkout .meloopets-checkout-wrapper .meloopets-custom-terms-text a:hover {
    color: var(--checkout-primary-hover);
    text-decoration: none;
}

/* ========================================
   ANIMACIONES
   ======================================== */

/* Animaciones - Específico Checkout */
.meloopets-checkout.checkout-page .woocommerce-checkout,
.meloopets-checkout .meloopets-checkout-wrapper .woocommerce-checkout {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}