/**
 * Pedido Frontend Styles
 * 
 * Styles for the customer-facing order tracking page.
 * Uses wimpli-components design system with var(--color-primary).
 * 
 * Layout: Single column, max-width 480px, mobile-first design.
 */

/* ============================================
   PAGE LAYOUT
   ============================================ */

   .pedido-frontend-wrapper {
    max-width: 90%;
    margin: 0 auto;
    padding: 2rem 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.5;
    width: 450px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ============================================
   WIMPLI BOX - Frontend Override
   ============================================ */

.pedido-frontend-wrapper .wimpli-box {
    background: #ffffff70;
    border: 1px solid rgb(from var(--color-primary) r g b / 15%);
    border-radius: 2rem;
    padding: 2rem;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgb(from var(--color-primary) r g b / 8%);
    transition: box-shadow 0.3s ease;
}

.pedido-frontend-wrapper .wimpli-box:hover {
    box-shadow: 0 4px 16px rgb(from var(--color-primary) r g b / 12%);
}

.pedido-frontend-wrapper .wimpli-box-header {
    padding-bottom: 1rem;
    margin-bottom: 0;
    border-bottom: 0px solid rgb(from var(--color-primary) r g b / 15%);
}

.pedido-frontend-wrapper .wimpli-box-title {
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary, #333);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.pedido-frontend-wrapper .wimpli-box-title-icon {
    font-size: 1.6rem;
    display: none;
}

/* ============================================
   ROW 1: ORDER HEADER
   ============================================ */

.pedido-frontend-wrapper .wimpli-box.pedido-header-box {
    background: var(--color-primary, #27ae60);
    color: white;
    text-align: center;
    border-color: transparent;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .wimpli-box-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1rem;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-customer-name {
    font-family: 'Quicksand', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-id-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-id-label {
    font-size: 1.4rem;
    opacity: 0.9;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-id-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.6rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 0.6rem;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.5rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: white;
    font-size: 1.4rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pedido-frontend-wrapper .wimpli-box.pedido-header-box .pedido-copy-btn:active {
    transform: scale(0.95);
}

.pedido-service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   ROW 2: CURRENT ORDER STATUS
   ============================================ */

.pedido-frontend-wrapper .order-current-status-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

.pedido-frontend-wrapper .order-current-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1.6rem;
    font-weight: 600;
    border-radius: 5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Status-specific colors */
.pedido-frontend-wrapper .order-current-status--recibido {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--confirmado {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--en_produccion {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--listo {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--en_camino {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--entregado,
.pedido-frontend-wrapper .order-current-status--cerrado {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--reclamo {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.pedido-frontend-wrapper .order-current-status--cancelado {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

/* ============================================
   ROW 3 & 4: CUSTOMER & DELIVERY INFO
   ============================================ */

.order-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.order-info-item-row {
    display: flex;
    gap: 1rem;
}

.order-info-item-row .order-info-item {
    flex: 1;
}

.order-info-item--full {
    width: 100%;
}

.order-info-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.order-info-value {
    font-size: 1.6rem;
    font-weight: 500;
    color: #333;
    word-break: break-word;
}

.order-info-value a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.order-info-value a:hover {
    color: rgb(from var(--color-primary) r g b / 80%);
    text-decoration: underline;
}

/* ============================================
   ROW 5: ORDER RESUMEN (PRODUCTS)
   ============================================ */

.order-resumen--frontend {
    /* Frontend order resumen container */
}

.order-resumen--frontend .order-resumen-products {
    margin-bottom: 1.5rem;
}

/* ===========================================
   ORDER CART - POS-LIKE STRUCTURE
   Uses same class names as POS for consistency
   Prefix: order- to avoid wimpli_food.js conflicts
   =========================================== */

/* Cart products container */
.pedido-frontend-wrapper .order-cart_products {
    width: 100%;
}

.pedido-frontend-wrapper .order-cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual cart item card - matches POS .cart-item */
.pedido-frontend-wrapper .order-cart-item {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 1.6rem;
    box-shadow: 0 2px 8px rgb(from var(--color-primary) r g b / 8%);
    padding: 2rem;
}

/* Cart product container - holds everything */
.pedido-frontend-wrapper .cart_product_container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Cart product row - CSS Grid for precise layout */
.pedido-frontend-wrapper .cart-product {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.5rem 1rem;
    align-items: start;
    margin-bottom: 0.5rem;
}

/* Product image container - spans 2 rows */
.pedido-frontend-wrapper .product_details {
    grid-row: 1 / 3;
    grid-column: 1;
}

.pedido-frontend-wrapper .product_image {
    width: 8rem;
    height: 8rem;
    border-radius: 1rem;
    overflow: hidden;
    background: #f5f5f5;
}

.pedido-frontend-wrapper .cart-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.8rem;
}

/* Quantity badge - top right */
.pedido-frontend-wrapper .cart-product .product_quantity,
.pedido-frontend-wrapper .order-cart-item .product_quantity {
    grid-row: 1;
    grid-column: 3;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.3rem !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pedido-frontend-wrapper .cart-product .product_quantity p,
.pedido-frontend-wrapper .order-cart-item .product_quantity p {
    font-weight: 700 !important;
    font-size: 2.4rem !important;
    min-width: 5rem !important;
    height: 4rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--color-primary, #837bd7) !important;
    color: white !important;
    border-radius: 0.8rem !important;
    padding: 0 0.6rem !important;
    margin: 0 !important;
}

.pedido-frontend-wrapper .bulk-unit-label {
    font-size: 1.1rem !important;
    color: #666 !important;
    margin-left: 0.2rem !important;
}

/* Product unit price - below quantity */
.pedido-frontend-wrapper .cart-product .product_unit_price,
.pedido-frontend-wrapper .order-cart-item .product_unit_price {
    grid-row: 2;
    grid-column: 3;
    display: block !important;
    font-weight: 700 !important;
    font-size: 1.8rem !important;
    text-align: right !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    opacity: 1 !important;
    white-space: nowrap !important;
}

/* Product name section */
.pedido-frontend-wrapper .product_name {
    padding-top: 0.5rem;
}

.pedido-frontend-wrapper .cart-item-product-title {
    /* display: block; */
    /* font-weight: 600; */
    /* font-size: 1.8rem; */
    /* color: #333; */
    /* margin-bottom: 0.3rem; */
    /* line-height: 1.3; */
}

.pedido-frontend-wrapper .product_name i {
    /* display: block; */
    /* font-style: italic; */
    /* font-size: 1.4rem; */
    /* color: #666; */
    /* margin-bottom: 0.5rem; */
}

/* Discount badge */
.pedido-frontend-wrapper .product_name .discount {
    /* display: inline-block; */
}

.pedido-frontend-wrapper .product_name .discount span {
    color: white;
}

/* Product settings (pasos, varieties, options, configura) */
.pedido-frontend-wrapper .product_Settings {
    margin-top: 0;
    padding-top: 0;
    width: 100%;
}

/* Product clarification / important note */
.pedido-frontend-wrapper .product_clarification {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 0.8rem;
    border-left: 4px solid #ffc107;
    font-size: 1.4rem;
    color: #856404;
}

.pedido-frontend-wrapper .product_clarification small {
    font-weight: 700;
}

/* ===========================================
   CUSTOMIZATION GROUPS - POS-LIKE STRUCTURE
   Styles for pasos, varieties, options, configura
   =========================================== */

/* Wrapper containers */
.pedido-frontend-wrapper .product_varieties,
.pedido-frontend-wrapper .product_options,
.pedido-frontend-wrapper .product_pasos_wrap {
    /* margin-bottom: 0.8rem; */
}

/* All customization group types */
.pedido-frontend-wrapper .product_options_group, .pedido-frontend-wrapper .product_configura_group, .pedido-frontend-wrapper .product_personalizar_group, .pedido-frontend-wrapper .product_adicionales_group, .pedido-frontend-wrapper .product_salsas_group, .pedido-frontend-wrapper .configura-adicionales, .pedido-frontend-wrapper .configura-personalizar {
    /* margin-bottom: 0.8rem; */
    /* padding: 0.8rem 1rem; */
    /* background: rgb(from var(--color-primary) r g b / 5%); */
    /* border-radius: 0.8rem; */
    /* border-left: 3px solid var(--color-primary, #837bd7); */
}

/* Nested configura groups (inside product_configura_group) */
.pedido-frontend-wrapper .product_configura_group .configura-adicionales,
.pedido-frontend-wrapper .product_configura_group .configura-personalizar {
    /* margin-left: 0.5rem; */
    /* margin-top: 0.5rem; */
    /* border-left-width: 2px; */
}

/* Group titles */
.pedido-frontend-wrapper .variety-group-title,
.pedido-frontend-wrapper .options-group-title {
    display: block;
    font-weight: 600;
    font-size: 1.6rem;
    color: #333;
    margin-bottom: 0.5rem;
    letter-spacing: 0;
}

/* Configura group title (product name) */
.pedido-frontend-wrapper .product_configura_group_title {
    display: block;
    font-weight: 600;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0.3rem;
}

/* Selection list (items within groups) */
.pedido-frontend-wrapper .selection-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pedido-frontend-wrapper .selection-list li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Quantity badge */
.pedido-frontend-wrapper .selection-qty {
    /* display: inline-flex; */
    /* align-items: center; */
    /* justify-content: center; */
    /* min-width: 2.2rem; */
    /* height: 2.2rem; */
    /* background: var(--color-primary, #837bd7); */
    /* font-size: 1.2rem; */
    /* font-weight: 600; */
    /* border-radius: 0.5rem; */
    /* padding: 0 0.4rem; */
}

/* Item label */
.pedido-frontend-wrapper .selection-label {
    /* display: inline-block; */
    /* padding: 0.4rem 0.8rem; */
    background: white;
    /* border: 1px solid rgb(from var(--color-primary) r g b / 20%); */
    /* border-radius: 0.6rem; */
    /* font-size: 1.3rem; */
    /* color: #333; */
}

/* "Pedido SIN" - important/removed items - red badge style */
.pedido-frontend-wrapper .selection-label.important {
    background: #c0392b;
    color: white;
    border-color: #c0392b;
    font-weight: 600;
}

/* Personalizar group styling (Pedido SIN) */
.pedido-frontend-wrapper .configura-personalizar {
    /* background: rgb(192 57 43 / 8%); */
    /* border-left-color: #c0392b; */
}

.pedido-frontend-wrapper .configura-personalizar .variety-group-title {
    /* color: #c0392b; */
}

/* Order item note/clarification */
.pedido-frontend-wrapper .order-item-note {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0.8rem;
    font-size: 1.3rem;
    color: #856404;
}

.pedido-frontend-wrapper .order-item-note strong {
    text-transform: uppercase;
}

/* Legacy productos styling (fallback) */
.order-resumen-products--legacy {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 1rem;
}

/* ============================================
   Resumen totals - Using POS classes for consistency
   ============================================ */

/* Main container */
.pedido-frontend-wrapper .resumen-total {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid rgb(from var(--color-primary) r g b / 15%);
    padding-top: 1.2rem;
    margin-top: 1rem;
}

/* Payment details section */
.pedido-frontend-wrapper .resumen-pago-section {
    margin-top: 0;
    padding-top: 0;
    gap: 0.5rem;
    display: flex;
    flex-direction: column;
}

/* Row layout */
.pedido-frontend-wrapper .resumen-pago-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    font-size: 1.4rem;
}

/* Label styling */
.pedido-frontend-wrapper .resumen-pago-label {
    font-weight: 500;
    color: rgb(102, 102, 102);
}

/* Value styling */
.pedido-frontend-wrapper .resumen-pago-value {
    font-weight: 600;
    color: rgb(51, 51, 51);
    text-align: right;
}

/* Discount row (green) */
.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-discount {
    color: rgb(76, 175, 80);
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-discount .resumen-pago-value {
    color: rgb(76, 175, 80);
    font-weight: 600;
}

/* Surcharge row (red) */
.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-surcharge {
    color: rgb(244, 67, 54);
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-surcharge .resumen-pago-value {
    color: rgb(244, 67, 54);
    font-weight: 600;
}

/* Coupon row - ticket style */
.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon {
    width: 100%;
    min-height: 0;
    border-radius: 1px;
    overflow: hidden;
    margin: 0.5rem 0;
    filter: drop-shadow(rgba(0, 0, 0, 0.2) 0px 1px 2px);
    display: flex;
    align-items: stretch;
    position: relative;
    background: transparent;
    padding: 0;
    border: none;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon::before,
.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon::after {
    content: "";
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: -1;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon::before {
    left: 0;
    background-image: radial-gradient(circle at 0px 50%, transparent 0.7rem, var(--color-primary, #9333ea) 0.7rem);
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon::after {
    right: 0;
    background-image: radial-gradient(circle at 100% 50%, transparent 0.7rem, var(--color-primary, #9333ea) 0.7rem);
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon > div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon .coupon-left {
    width: 1rem;
    border-right: 0;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon .coupon-left div {
    transform: rotate(-90deg);
    white-space: nowrap;
    font-weight: bold;
    font-size: 1.2rem;
    color: #fff;
    display: none;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon .coupon-center {
    flex: 1;
    text-align: center;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 1rem;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon .coupon-center h3 {
    font-size: 1.6rem;
    margin: 0;
    color: #fff;
    font-weight: 600;
    font-family: "Courier New", monospace;
}

.pedido-frontend-wrapper .resumen-pago-row.resumen-pago-coupon.coupon .coupon-center .coupon-discount-amount {
    font-size: 1.4rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Total quantity and amount container */
.pedido-frontend-wrapper .resumen-total-quantity-amount-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0;
    padding-top: 1rem;
    border-top: 1px solid rgb(from var(--color-primary) r g b / 20%);
}

/* Total label */
.pedido-frontend-wrapper .resumen-total-quantity {
    font-size: 14px;
    font-weight: 600;
    color: rgb(102, 102, 102);
}

/* Total amount */
.pedido-frontend-wrapper .resumen-total-amount {
    font-size: 2rem;
    font-weight: 700;
    text-align: right;
    /* color: var(--color-primary); */
    margin-left: auto;
}

/* ============================================
   ROW 6: PAYMENT DETAILS
   ============================================ */

.order-payment-status {
    text-align: center;
    margin-bottom: 1.5rem;
}

.order-payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.6rem;
    border-radius: 3rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.order-payment-badge--paid {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.order-payment-badge--pending {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: white;
}

.order-payment-badge-icon {
    font-size: 1.6rem;
}

/* MercadoPago Button */
.order-payment-action {
    text-align: center;
    margin-bottom: 1.5rem;
}

.mercadopago-payment-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, #00a650 0%, #00d4aa 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.4rem;
    border-radius: 3rem;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 166, 80, 0.3);
    transition: all 0.3s ease;
}

.mercadopago-payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 80, 0.4);
}

.mercadopago-payment-btn:active {
    transform: translateY(0);
}

.mercadopago-payment-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.mercadopago-payment-btn-icon {
    font-size: 2rem;
}

.order-payment-hint {
    margin: 0.8rem 0 0 0;
    font-size: 1.3rem;
    color: #666;
}

/* Payment Info Grid */
.order-payment-info {
    background: rgb(from var(--color-primary) r g b / 5%);
    border-radius: 1rem;
    padding: 1rem;
}

.order-payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgb(from var(--color-primary) r g b / 10%);
}

.order-payment-row:last-child {
    border-bottom: none;
}

.order-payment-label {
    font-size: 1.4rem;
    color: #666;
    font-weight: 500;
}

.order-payment-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.order-payment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.3rem;
    margin-top: 1rem;
}

.order-payment-table th,
.order-payment-table td {
    padding: 0.6rem;
    text-align: left;
    border-bottom: 1px solid rgb(from var(--color-primary) r g b / 10%);
}

.order-payment-table th {
    font-weight: 600;
    color: #666;
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* ============================================
   ROW 7: FLOATING CHAT BUTTON
   ============================================ */

.pedido-chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, rgb(from var(--color-primary) r g b / 85%) 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgb(from var(--color-primary) r g b / 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transform-origin: center;
    transition:
        opacity 0.28s ease,
        transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
        visibility 0s linear 0s,
        box-shadow 0.3s ease;
}

/* FAB tucks away while panel opens so it reads as one motion from the same corner */
body:has(#pedido-chat-panel.is-open) #pedido-chat-fab {
    opacity: 0;
    transform: scale(0.45);
    pointer-events: none;
    visibility: hidden;
    transition:
        opacity 0.22s ease,
        transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
        visibility 0s linear 0.28s,
        box-shadow 0.3s ease;
}

/* Matches backend header: dashicons-email-alt (\f466) */
.pedido-chat-fab .pedido-chat-fab-icon.dashicons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    font-size: 3rem;
    line-height: 1;
    color: inherit;
}

.pedido-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgb(from var(--color-primary) r g b / 50%);
}

.pedido-chat-fab:active {
    transform: scale(0.95);
}

.pedido-chat-fab .chat-unread-badge {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    min-width: 2.2rem;
    height: 2.2rem;
    background: var(--color-red, #e74c3c);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
}

/* Chat panel: same fixed corner as FAB; scales up from bottom-right */
.pedido-chat-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: calc(100% - 4rem);
    max-width: 400px;
    max-height: 60vh;
    background: white;
    border-radius: 1.6rem;
    box-shadow: 0rem 0.5rem 3rem  color-mix(in srgb, var(--color-primary), #2e2e2e47 78%);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.22);
    transition:
        opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1),
        transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
        box-shadow 0.35s ease,
        visibility 0s linear 0.4s;
}

.pedido-chat-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition:
        opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1),
        transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
        box-shadow 0.35s ease,
        visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
    .pedido-chat-panel {
        transition-duration: 0.01ms !important;
        transform: scale(1);
    }

    .pedido-chat-panel:not(.is-open) {
        opacity: 0;
        transform: none;
        visibility: hidden;
        pointer-events: none;
    }

    .pedido-chat-panel.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body:has(#pedido-chat-panel.is-open) #pedido-chat-fab {
        transition-duration: 0.01ms !important;
        opacity: 0;
        transform: scale(1);
    }
}

.pedido-chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, rgb(from var(--color-primary) r g b / 85%) 100%);
    color: white;
}

.pedido-chat-panel-title {
    font-size: 1.6rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.pedido-chat-panel-title .pedido-chat-panel-title-icon.dashicons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
    color: inherit;
}

.pedido-chat-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.pedido-chat-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pedido-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    min-height: 200px;
    max-height: 300px;
}

.pedido-chat-input-wrap {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
    border-top: 1px solid rgb(from var(--color-primary) r g b / 15%);
    background: #f1f1f1;
}

.pedido-chat-input {
    flex: 1;
    padding: 1rem 1.2rem !important;
    border: 1px solid #ddd;
    border-radius: 1rem !important;
    font-size: 1.5rem;
    outline: none;
    transition: border-color 0.2s ease;
    box-shadow: rgb(0 0 0 / 9%) 1px 2px 3px inset, rgba(0, 0, 0, 0.2) -1px -1px 3px inset;
}

.pedido-chat-input:focus {
    border-color: var(--color-primary);
}

.pedido-chat-send-btn {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* dashicons-email-alt (\f466) + dashicons-update while posting */
.pedido-chat-send-btn .pedido-chat-send-btn-icon.dashicons {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 2.2rem;
    line-height: 1;
    color: inherit;
}

/* Must beat .pedido-chat-send-btn-icon.dashicons (same element also has .dashicons) */
.pedido-chat-send-btn:not(.is-sending) .pedido-chat-send-btn-icon--busy.dashicons {
    display: none;
}

.pedido-chat-send-btn.is-sending .pedido-chat-send-btn-icon--idle.dashicons {
    display: none;
}

.pedido-chat-send-btn.is-sending .pedido-chat-send-btn-icon--busy.dashicons {
    display: inline-flex;
    animation: pedido-chat-send-spin 0.85s linear infinite;
}

@keyframes pedido-chat-send-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.pedido-chat-send-btn:hover {
    background: rgb(from var(--color-primary) r g b / 85%);
    transform: scale(1.05);
}

.pedido-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat Messages */
.chat-msg {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
}

.chat-msg.from-customer {
    align-items: flex-end;
}

.chat-msg.from-admin {
    align-items: flex-start;
}

.msg-sender {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    padding: 0 0.8rem;
    color: #666;
}

.msg-bubble {
    max-width: 85%;
    padding: 1rem 1.4rem;
    border-radius: 1.6rem;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 1.5rem;
}

.chat-msg.from-customer .msg-bubble {
    background: var(--color-primary);
    color: white;
    border-bottom-right-radius: 0.4rem;
}

.chat-msg.from-admin .msg-bubble {
    background: #e4e6eb;
    color: #050505;
    border-bottom-left-radius: 0.4rem;
}

.msg-time {
    font-size: 1.1rem;
    margin-top: 0.3rem;
    padding: 0 0.8rem;
    color: #999;
}

.no-messages,
.loading-messages,
.chat-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 1.4rem;
    text-align: center;
}

.chat-error {
    color: var(--color-red, #e74c3c);
}
.product_pasos_wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* ============================================
   CONFIRMATION OVERLAYS
   ============================================ */

.pedido-confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.pedido-confirmation-content {
    padding: 4rem 3rem;
    border-radius: 2rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    width: 400px;
}

.pedido-confirmation-content--success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.pedido-confirmation-content--error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.pedido-confirmation-icon {
    font-size: 6rem;
    margin-bottom: 1.5rem;
}

.pedido-confirmation-title {
    margin: 0 0 1rem 0;
    font-size: 2.4rem;
    font-weight: 700;
}

.pedido-confirmation-text {
    margin: 0 0 2rem 0;
    font-size: 1.6rem;
    opacity: 0.95;
}

.pedido-confirmation-btn {
    background: white;
    border: none;
    padding: 1.2rem 3rem;
    border-radius: 3rem;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.pedido-confirmation-content--success .pedido-confirmation-btn {
    color: #28a745;
}

.pedido-confirmation-content--error .pedido-confirmation-btn {
    color: #e74c3c;
}

.pedido-confirmation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   STATUS NOTIFICATIONS
   ============================================ */

.pedido-status-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--color-green, #27ae60);
    color: white;
    padding: 1.2rem 2rem;
    border-radius: 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 1.4rem;
    font-weight: 600;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* ============================================
   PRINT STYLES
   ============================================ */

