/* =====================================================
   PÁGINA DE PRODUCTO - ESTILOS MEJORADOS
   ===================================================== */

/* Variables CSS para consistencia */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* =====================================================
   BREADCRUMBS
   ===================================================== */
.breadcrumb-nav {
    margin-bottom: 2rem;
    padding: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    list-style: none;
    background: transparent;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 0.75rem;
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* =====================================================
   LAYOUT PRINCIPAL
   ===================================================== */
.product-row {
    margin-top: 1rem;
   /* gap: 3rem;*/
}

/* =====================================================
   GALERÍA DE PRODUCTO
   ===================================================== */
.product-gallery {
    position: sticky;
    top: 100px;
}

.gallery-main-image {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1.1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.gallery-main-image:hover {
    box-shadow: var(--shadow-md);
}

.product-badges {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    animation: slideInLeft 0.5s ease-out;
}

.badge-sale {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
}

.badge-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--white);
}

.main-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.main-image:hover {
    transform: scale(1.05);
}

/* Thumbnails */
.gallery-thumbnails {
    position: relative;
}

.thumbnails-slider .swiper-wrapper {
    display: flex;
    /*gap: 1rem;*/
}

.thumbnail-item {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    overflow: hidden;
}

.thumbnail-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.thumbnail-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.thumbnail-item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    display: block;
}

.thumbnail-nav {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.thumbnail-nav button {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.thumbnail-nav button:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* =====================================================
   INFORMACIÓN DEL PRODUCTO
   ===================================================== */
.product-info {
    animation: fadeInUp 0.6s ease-out;
}

.product-header {
    margin-bottom: 1.5rem;
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.stock-status.in-stock {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stock-status.out-stock {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stock-status svg {
    width: 14px;
    height: 14px;
}

.product-sku {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* =====================================================
   PRECIO
   ===================================================== */
.product-pricing {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
}

.price-group {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.price-current {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    letter-spacing: -0.025em;
}

.price-original {
    font-size: 1.5rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.savings-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.savings-info svg {
    width: 16px;
    height: 16px;
    animation: pulse 2s ease-in-out infinite;
}

/* =====================================================
   CARACTERÍSTICAS
   ===================================================== */
.product-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.feature-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* =====================================================
   FORMULARIO
   ===================================================== */
.product-form {
    margin-bottom: 2rem;
}

.quantity-wrapper {
    margin-bottom: 1.5rem;
}

.quantity-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
   /* text-transform: uppercase;*/
    letter-spacing: 0.05em;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--white);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.quantity-selector:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.qty-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
     
    font-weight: 500;
    font-size: 25px;
}

.qty-btn:hover {
    background: var(--bg-light);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-btn svg {
    width: 12px;
    height: 12px;
}

.qty-decrease {
    color: var(--danger-color);
}

.qty-decrease:hover {
    background: rgba(239, 68, 68, 0.05);
}

.qty-increase {
    color: var(--primary-color);
}

.qty-increase:hover {
    background: rgba(37, 99, 235, 0.05);
}

.qty-input {
    border: none;
    outline: none;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 80px;
    background: transparent;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Botones de Acción */
.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-add-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-add-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-add-cart:hover::before {
    left: 100%;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-add-cart:active {
    transform: translateY(0);
}

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

.btn-icon,
.btn-text {
    transition: var(--transition);
}

.btn-wishlist {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.btn-wishlist:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-wishlist.active {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--white);
}

.btn-wishlist svg {
    width: 22px;
    height: 22px;
    transition: var(--transition);
}

.btn-wishlist:hover svg {
    transform: scale(1.1);
}

/* =====================================================
   DETALLES DEL PRODUCTO
   ===================================================== */
.product-details {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.details-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.details-description {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.details-specs {
    display: grid;
    gap: 0.2rem;
}

.spec-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.spec-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
    font-size: 0.875rem;
}

.spec-value {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* =====================================================
   COMPARTIR
   ===================================================== */
.product-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.share-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn:nth-child(1):hover {
    background: #1877f2;
    border-color: #1877f2;
    color: var(--white);
}

.share-btn:nth-child(2):hover {
    background: #000000;
    border-color: #000000;
    color: var(--white);
}

.share-btn:nth-child(3):hover {
    background: #25d366;
    border-color: #25d366;
    color: var(--white);
}

/* =====================================================
   TOAST DE ÉXITO
   ===================================================== */
.success-toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--success-color);
    animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-in 2.7s forwards;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toast-icon {
    flex-shrink: 0;
}

.toast-text strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-text p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.spinner {
    animation: spin 1s linear infinite;
}

/* =====================================================
   BARRA MÓVIL FIJA INFERIOR
   ===================================================== */
.mobile-bottom-bar {
    display: none; /* Oculto por defecto en desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 1rem;
    animation: slideUpMobile 0.3s ease-out;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.mobile-bottom-bar.visible {
    transform: translateY(0);
}

.mobile-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 100%;
}

.mobile-bar-info {
    flex: 1;
    min-width: 0;
    display: flex;
   /* flex-direction: column;*/
    gap: 0.5rem;
}

.mobile-bar-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-content: space-around;
}

.mobile-price-current {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.mobile-price-original {
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: line-through;
}

/* Contador de Cantidad Móvil */
.mobile-quantity-selector {
    display: inline-flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.mobile-qty-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-qty-btn:active {
    transform: scale(0.9);
}

.mobile-qty-dec {
    color: var(--danger-color);
}

.mobile-qty-dec:active {
    background: rgba(239, 68, 68, 0.1);
}

.mobile-qty-inc {
    color: var(--primary-color);
}

.mobile-qty-inc:active {
    background: rgba(37, 99, 235, 0.1);
}

.mobile-qty-display {
    min-width: 35px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 0.25rem;
    user-select: none;
}

/* Botón Agregar Móvil */
.mobile-bar-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.mobile-bar-btn:active {
    transform: scale(0.95);
}

.mobile-bar-btn svg {
    width: 20px;
    height: 20px;
}

/* Mostrar solo en móviles */
@media (max-width: 767px) {
    .mobile-bottom-bar {
        display: block;
    }
    
    /* Agregar padding al body para que el contenido no quede oculto */
    body {
        padding-bottom: 90px;
    }
}

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

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 991px) {
    .product-gallery {
        position: static;
        margin-bottom: 2rem;
    }
    
    .product-title {
        font-size: 1.75rem;
    }
    
    .price-current {
        font-size: 2rem;
    }
    
    .product-row {
        gap: 2rem;
    }
}

@media (max-width: 767px) {
    .breadcrumb-nav {
        margin-bottom: 1.5rem;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .price-current {
        font-size: 1.75rem;
    }
    
    .price-original {
        font-size: 1.25rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-wishlist {
        width: 100%;
    }
    
    .product-features {
        padding: 1rem;
    }
    
    .product-details {
        padding: 1.5rem;
    }
    
    .success-toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .product-share {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575px) {
    .gallery-main-image {
        padding: 1rem;
    }
    
    .main-image {
        max-height: 300px;
    }
    
    .product-badges {
        top: 1rem;
        left: 1rem;
    }
    
    .badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.625rem;
    }
    
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .btn-add-cart {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
}

/* Ajustes para pantallas muy pequeñas (320px - 400px) */
@media (max-width: 400px) {
    .mobile-bottom-bar {
        padding: 0.75rem 0.875rem;
    }
    
    .mobile-bar-content {
        gap: 0.625rem;
    }
    
    .mobile-bar-info {
        gap: 1.375rem;
    }
    
    .mobile-price-current {
        font-size: 1.25rem;
    }
    
    .mobile-price-original {
        font-size: 0.75rem;
    }
    
    .mobile-quantity-selector {
       /* transform: scale(0.9);
        transform-origin: left;*/
    }
    
    .mobile-qty-btn {
        padding: 0.775rem 0.825rem;
    }
    
    .mobile-qty-display {
        min-width: 30px;
        font-size: 0.875rem;
    }
    
    .mobile-bar-btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .mobile-bar-btn span {
        display: none; /* Ocultar texto "Agregar" */
    }
    
    .mobile-bar-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* Ajuste para pantallas intermedias móviles */
@media (min-width: 401px) and (max-width: 575px) {
    .mobile-bar-btn {
        padding: 0.875rem 1.25rem;
    }
}

/* =====================================================
   UTILIDADES
   ===================================================== */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-2 {
    margin-top: 1rem !important;
}

.hidden {
    display: none !important;
}