/* =====================================================
   Pyrene Viajes — Estilos WooCommerce Custom
   Afectan a carrito, checkout, cuenta y tienda
   ===================================================== */

/* ── Página WC general ── */
.pyrene-wc-main {
    min-height: 70vh;
}

/* Eliminar estilos WC que chocan con Tailwind */
.woocommerce-page table.shop_table,
.woocommerce table.shop_table {
    border: none !important;
}

/* ── Cabecera de la página carrito ── */
.pyrene-cart-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.pyrene-cart-page-title {
    font-size: 28px;
    font-weight: 800;
    color: #111;
    margin: 0;
}

.pyrene-cart-back-link {
    color: #4E0000;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}

.pyrene-cart-back-link:hover { opacity: 0.75; text-decoration: none; color: #4E0000; }

/* ── Layout: items + totales ── */
.pyrene-cart-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.pyrene-cart-page-header { grid-column: 1 / -1; }

.pyrene-cart-totals-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 28px;
}

/* ── Carrito vacío ── */
.pyrene-cart-empty {
    text-align: center;
    padding: 64px 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.pyrene-cart-empty-icon { font-size: 64px; margin-bottom: 16px; }
.pyrene-cart-empty h2 { font-size: 24px; font-weight: 700; color: #111; margin-bottom: 8px; }
.pyrene-cart-empty p  { color: #6b7280; margin-bottom: 24px; }
.pyrene-cart-empty-btn {
    display: inline-block;
    padding: 13px 28px;
    background: #4E0000;
    color: #fff !important;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.15s;
}
.pyrene-cart-empty-btn:hover { opacity: 0.9; text-decoration: none; }

/* ── Items del carrito ── */
.pyrene-cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.pyrene-cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.pyrene-cart-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    border-color: #d1d5db;
}

/* Imagen */
.pyrene-cart-item-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Info */
.pyrene-cart-item-name {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    margin-bottom: 6px;
    line-height: 1.3;
}
.pyrene-cart-item-name a { color: inherit; text-decoration: none; }
.pyrene-cart-item-name a:hover { color: #4E0000; }

.pyrene-cart-item-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}
.pyrene-cart-item-meta dl, .pyrene-cart-item-meta dd, .pyrene-cart-item-meta dt { margin: 0; }

.pyrene-cart-item-unit-price {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}
.pyrene-per-unit { font-size: 12px; color: #9ca3af; font-weight: 400; }

/* Cantidad */
.pyrene-cart-item-qty { text-align: center; }
.pyrene-qty-label { display: block; font-size: 12px; color: #9ca3af; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Override input de cantidad WC */
.pyrene-cart-item-qty .qty,
.pyrene-cart-item-qty input.qty {
    width: 64px !important;
    padding: 8px 10px !important;
    text-align: center !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #fafafa !important;
    color: #111 !important;
    -moz-appearance: textfield;
}
.pyrene-cart-item-qty .qty:focus { border-color: #4E0000 !important; outline: none !important; }
.pyrene-cart-item-qty .qty::-webkit-inner-spin-button { opacity: 0; }

.pyrene-cart-qty-fixed { font-size: 18px; font-weight: 700; color: #111; }

/* Subtotal */
.pyrene-cart-item-subtotal { text-align: right; min-width: 80px; }
.pyrene-subtotal-label { display: block; font-size: 12px; color: #9ca3af; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.pyrene-subtotal-val { font-size: 18px; font-weight: 800; color: #4E0000; }

/* Botón eliminar */
.pyrene-cart-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626 !important;
    font-size: 20px;
    text-decoration: none !important;
    font-weight: 300;
    line-height: 1;
    transition: background 0.15s, transform 0.15s;
}
.pyrene-cart-remove:hover {
    background: #fecaca;
    transform: scale(1.1);
    text-decoration: none !important;
}

/* ── Botón actualizar ── */
.pyrene-cart-update-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.pyrene-cart-update-btn,
.pyrene-cart-update-btn.button {
    padding: 10px 22px !important;
    background: transparent !important;
    color: #4E0000 !important;
    border: 2px solid #4E0000 !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s !important;
}
.pyrene-cart-update-btn:hover {
    background: #4E0000 !important;
    color: #fff !important;
}

/* ── Totales (inyectado por WC) ── */
.pyrene-cart-totals-section .cart_totals h2,
.pyrene-cart-totals-section .cart-collaterals h2 {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.pyrene-cart-totals-section table.shop_table {
    width: 100%;
    border-collapse: collapse;
}

.pyrene-cart-totals-section table.shop_table th,
.pyrene-cart-totals-section table.shop_table td {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
    vertical-align: middle;
}

.pyrene-cart-totals-section table.shop_table th {
    color: #6b7280;
    font-weight: 600;
    width: 40%;
}

.pyrene-cart-totals-section .order-total th,
.pyrene-cart-totals-section .order-total td {
    font-size: 20px;
    font-weight: 800;
    color: #111;
    border-bottom: none;
    padding-top: 16px;
}

.pyrene-cart-totals-section .order-total .amount {
    color: #4E0000;
}

/* Botón Tramitar pedido */
.pyrene-cart-totals-section .checkout-button,
.pyrene-cart-totals-section a.checkout-button {
    display: block !important;
    width: 100% !important;
    margin-top: 20px !important;
    padding: 16px !important;
    background: #4E0000 !important;
    color: #fff !important;
    text-align: center !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
    border: none !important;
    text-decoration: none !important;
    transition: opacity 0.2s, transform 0.2s !important;
    letter-spacing: 0.02em !important;
}

.pyrene-cart-totals-section .checkout-button:hover {
    opacity: 0.92 !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

/* ── Cupones ── */
.woocommerce-cart .coupon {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
}

.woocommerce-cart .coupon input.input-text {
    padding: 9px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    max-width: 200px;
}

.woocommerce-cart .coupon button,
.woocommerce-cart .coupon .button {
    padding: 9px 18px;
    background: #374151;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.woocommerce-cart .coupon button:hover { background: #1f2937; }

/* ── Mensajes WC ── */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    padding: 14px 18px !important;
    font-size: 14px !important;
}
.woocommerce-message { background: #f0fdf4 !important; border-left: 4px solid #22c55e !important; }
.woocommerce-info    { background: #eff6ff !important; border-left: 4px solid #3b82f6 !important; }
.woocommerce-error   { background: #fef2f2 !important; border-left: 4px solid #ef4444 !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .pyrene-cart-item {
        grid-template-columns: 72px 1fr auto;
        grid-template-rows: auto auto auto;
    }
    .pyrene-cart-item-image img { width: 72px; height: 72px; }
    .pyrene-cart-item-details   { grid-column: 2 / 4; }
    .pyrene-cart-item-qty       { grid-column: 2; }
    .pyrene-cart-item-subtotal  { grid-column: 3; text-align: right; }
    .pyrene-cart-item-remove-wrap { grid-column: 1; grid-row: 1; display: flex; justify-content: flex-end; }

    .pyrene-cart-page-header { flex-direction: column; align-items: flex-start; }
    .pyrene-cart-update-row  { justify-content: flex-start; }
}
