/* ====================================
   PRODUCTOS RELACIONADOS - HORIZONTAL COMPACTO
   ==================================== */

   .related-products-wrapper {
    width: 100%;
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

/* Header */
.related-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e8f4f8;
}

.titulo-related {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.icon-star {
    stroke: #fbbf24;
    fill: none;
    stroke-width: 2;
}

.related-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Grid = Lista Vertical */
.related-products-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* ============================================
   TARJETA HORIZONTAL - ESTO ES LO IMPORTANTE
   ============================================ */
.related-product-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    
    /* CLAVE: Flex horizontal */
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    
    /*height: 110px;*/
    overflow: hidden;
    max-width: 100%;
}

.related-product-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Badge de comentario */
.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: 90px;
    transition:max-width .3s ease;
}

.product-badge svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.badge-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
article.related-product-card:hover .product-badge {
	max-width: 100%;
}

/* ============================================
   IMAGEN - IZQUIERDA, TAMAÑO FIJO
   ============================================ */
.product-image-container {
    position: relative;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    height: 110px;
    flex-shrink: 0;
    background: #f8f9fa;
    overflow: hidden;
}

.product-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image.loaded {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.related-product-card:hover .product-image {
    transform: scale(1.05);
}

.no-product-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
}

.no-product-image svg {
    stroke: #94a3b8;
    stroke-width: 1.5;
}

/* Badges de stock sobre imagen */
.stock-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
}

.stock-badge.out-of-stock {
    background: #fbbf24;
    color: #78350f;
}

.stock-badge.low-stock {
    background: #ef4444;
    color: white;
}

/* ============================================
   INFO - DERECHA, OCUPA EL RESTO
   ============================================ */
.product-info-container {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.product-name a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a:hover {
    color: #3b82f6;
}

/* Atributos */
.product-attributes {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #64748b;
    padding: 2px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    border-left: 2px solid #3b82f6;
    line-height: 1.2;
}

.product-attributes svg {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
}

/* Stock info */
.product-stock-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.stock-available {
    color: #059669;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-available svg {
    width: 12px;
    height: 12px;
}

.stock-unavailable {
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-unavailable svg {
    width: 12px;
    height: 12px;
}

/* ============================================
   PRECIO Y BOTÓN - EN LA MISMA LÍNEA
   ============================================ */
.product-price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111 !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Botón añadir */
.btn-add-related-cart {
    padding: 0.4rem 0.65rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
}

.btn-add-related-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-add-related-cart.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-add-related-cart.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-add-related-cart.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.cart-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-text {
    font-weight: 600;
}

.spinner {
    display: none;
}

.btn-add-related-cart.loading .btn-text {
    display: none;
}

.btn-add-related-cart.loading .spinner {
    display: block;
}

.spinner-icon {
    animation: spin 0.8s linear infinite;
    width: 16px;
    height: 16px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Footer */
.related-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 2px dashed #e2e8f0;
}

.link-more-products {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.link-more-products:hover {
    background: #eff6ff;
    color: #2563eb;
    transform: translateX(4px);
}

.link-more-products svg {
    width: 18px;
    height: 18px;
}

/* Toast notificación */
.cart-notification {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 99999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    min-width: 280px;
    max-width: 350px;
    display: none;
}

.cart-notification.success {
    border-left: 4px solid #10b981;
}

.cart-notification.error {
    border-left: 4px solid #ef4444;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notification-icon {
    flex-shrink: 0;
    stroke: #10b981;
    width: 20px;
    height: 20px;
}

.cart-notification.error .notification-icon {
    stroke: #ef4444;
}

.notification-text {
    flex: 1;
}

.notification-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 3px;
}

.notification-message {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media(min-width: 768px) and (max-width:1024px) {
    .related-product-card .product-image-container {
        max-width: 70px;
		min-width: unset;
		
    }
	.related-products-wrapper {
		padding: 0.5rem !important
	}
	
}
@media (max-width: 768px) {
    .related-products-wrapper {
        padding: 1rem;
    }

    .related-product-card {
        height: unset;
        padding-top:26px
    }
    .product-badge {
        margin-top:-4px;
        max-width: 100%;
    }

    .product-image-container {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        height: 100px;
    }

    .product-info-container {
        padding: 0.6rem;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1.1rem;
    }
}
@media (max-width: 480px) {
    .related-product-card {
        height: unset;
    }

    .product-image-container {
        width: 90px;
        min-width: 90px;
        max-width: 90px;
        height: 90px;
    }

    .product-price-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .btn-add-related-cart {
        width: 100%;
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}