/* Estilos específicos de la página de producto - Estilo MercadoLibre */
.contenedor-products {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    padding: 24px;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 150px);
    background-color: #f5f5f5;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.product-img {
    flex: 1;
    text-align: center;
    padding: var(--spacing-lg);
    background-color: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--box-shadow-md);
    animation: fadeIn 0.8s ease-out;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    box-sizing: border-box;
    width: 100%;
    min-width: 280px;
}

.product-img:hover {
    transform: scale(1.01);
}

.product-data {
    flex: 1;
    min-width: 320px;
    padding: 32px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.8s ease-out 0.2s backwards;
    box-sizing: border-box;
}

/* Asegurar dos columnas en pantallas grandes */
@media (min-width: 768px) {
    .product-img,
    .product-data {
        flex-basis: calc(50% - var(--spacing-lg) / 2);
        max-width: calc(50% - var(--spacing-lg) / 2);
    }
}

.product-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
}

.product-category {
    font-size: 0.9em;
    color: var(--text-color-light);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xxs);
    font-weight: 500;
}

.product-title {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: left;
}

.original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 8px;
    font-weight: 400;
}

.product-price {
    font-size: 2rem;
    color: #333;
    font-weight: 400;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.discount-percentage {
    background-color: #00a650;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 12px;
}

.stock-info {
    font-size: 0.875rem;
    color: #00a650;
    font-weight: 400;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.buy-now-button {
    background-color: #3483fa;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
    transition: background-color 0.2s ease;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.buy-now-button:hover {
    background-color: #2968c8;
}

.add-to-cart-button {
    background-color: transparent;
    color: #3483fa;
    border: 1px solid #3483fa;
    padding: 16px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.add-to-cart-button:hover {
    background-color: #f7f9fc;
}

.add-to-cart-button.success {
    background-color: #4caf50 !important;
    color: white !important;
    border-color: #4caf50 !important;
}

.add-to-cart-button.success i {
    background-color: white;
    color: #4caf50;
    border-radius: 50%;
    padding: 2px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shipping-options {
    margin-bottom: var(--spacing-md);
    margin-top: 40px;
    padding: var(--spacing-md);
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.shipping-options h3 {
    color: var(--text-color-dark);
    font-size: 1.3em;
    margin-bottom: var(--spacing-md);
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
}

.shipping-note {
    font-size: 0.85em;
    color: var(--text-color-muted);
    text-align: center;
    margin-top: var(--spacing-md);
    font-style: italic;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Estilos para las Migas de Pan (Breadcrumbs) */
.breadcrumbs-container {
    width: 100%;
    max-width: 1200px;
    margin: var(--spacing-md) auto 0 auto;
    padding: var(--spacing-sm) var(--spacing-xl);
    box-sizing: border-box;
}

.breadcrumbs {
    list-style: none;
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: var(--text-color-light);
}

.breadcrumbs li {
    margin-right: var(--spacing-xs);
}

.breadcrumbs li:last-child {
    font-weight: 600;
    color: var(--text-color-dark);
}

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

.breadcrumbs a:hover {
    color: #0056b3;
}

/* Estilos para notificación del carrito */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    font-weight: 600;
    font-size: 14px;
    max-width: 300px;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-notification i {
    font-size: 18px;
    flex-shrink: 0;
}

.cart-notification.error {
    background-color: #f44336;
}

/* Animación de entrada */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive para móviles */
@media (max-width: 576px) {
    .contenedor-products {
        padding: 12px !important;
        gap: 16px !important;
    }

    .product-img,
    .product-data {
        width: 100% !important;
        flex-basis: auto !important;
        max-width: 100% !important;
        padding: 16px !important;
        min-width: unset !important;
    }

    .product-title {
        font-size: 1.25rem;
    }

    .product-price {
        font-size: 1.5rem;
    }

    .buy-now-button,
    .add-to-cart-button {
        padding: 12px 16px !important;
        font-size: 0.9em;
    }

    /* Reducir márgenes de secciones adicionales en móviles */
    .product-description-end {
        margin: 16px 12px !important;
        padding: 12px !important;
    }

    .purchase-features {
        margin-top: 16px !important;
        padding: 12px !important;
    }
}

/* Estilos para productos relacionados */
.related-product-card {
    border: 1px solid #e0e7ef;
    border-radius: 8px;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.related-product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    border-color: #d0d7de;
}

.related-product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.related-product-info {
    padding: 15px;
    background: white;
    position: relative;
    z-index: 2;
}

.related-product-price {
    font-size: 1.2rem;
    color: #232c85;
    font-weight: 700;
    margin-bottom: 10px;
}

.agregar {
    background-color: #1a2163;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.agregar:hover {
    background-color: #0f1629;
    transform: translateY(-1px);
}

/* Responsive para productos relacionados */
@media (max-width: 768px) {
    .related-product-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

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

/* Estilos para los iconos de características de compra */
.purchase-features .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.purchase-features .feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.purchase-features .feature-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    border-radius: 50% !important;
    background: #3483fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.purchase-features .feature-content h4 {
    margin: 0 0 4px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.purchase-features .feature-content p {
    margin: 0;
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ocultar elementos no usados */
.product-meta, .sales-info, .rating, .installments {
    display: none;
}

/* Fix overflow issues on mobile */
@media (max-width: 576px) {
    /* Mensajes de descuento con mejor manejó de texto largo */
    .discount-message, .cash-transfer-price {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 0.85rem !important;
        padding: 6px 8px !important;
    }

    /* Asegurar que los contenedores de descuento no desborden */
    .discount-message {
        margin-top: 8px !important;
        margin-bottom: 8px !important;
    }

    .cash-transfer-price {
        margin-top: 8px !important;
        margin-bottom: 0 !important;
    }

    /* Contenedor de precios más restrictivo */
    .precio-container {
        width: 100%;
        max-width: calc(100vw - 32px);
        overflow: hidden;
    }

    /* Botones con mejor responsive */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px !important;
        width: 100%;
    }

    .buy-now-button, .add-to-cart-button {
        width: 100% !important;
        max-width: calc(100vw - 32px) !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        display: block !important;
        text-align: center !important;
        padding: 12px 16px !important;
    }

    /* Product data principal */
    .product-data {
        width: 100% !important;
        max-width: calc(100vw - 24px) !important;
    }
}
