/* Usando variables globales de home.css */

.product-detail-container {
    padding: 40px 0;
    background: #fff;
}

.breadcrumbs {
    margin-bottom: 30px;
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.breadcrumbs a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.3s;
}

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

.breadcrumbs .current {
    color: var(--primary-color);
    font-weight: 600;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

/* Galería */
.product-gallery {
    position: sticky;
    top: 20px;
}

.main-image {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

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

.tag-sale {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    /* Usamos el rojo de acento del proyecto */
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    z-index: 10;
}

.thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumb {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    padding: 5px;
    transition: all 0.3s;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb.active,
.thumb:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(140, 197, 217, 0.2);
    /* Sombra acorde al azul del proyecto */
}

/* Info Section */
.product-header .sku {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.product-header h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-main);
    line-height: 1.2;
}

.rating {
    color: #ffc107;
    font-size: 18px;
    margin-bottom: 20px;
}

.rating .reviews {
    color: var(--text-muted);
    font-size: 14px;
    margin-left: 5px;
}

.product-pricing {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
}

.old-price {
    font-size: 20px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 5px;
}

.product-description p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 15px;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.quantity-selector {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.quantity-selector button {
    background: var(--light-gray);
    border: none;
    width: 40px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.quantity-selector button:hover {
    background: #e0e0e0;
}

.quantity-selector input {
    flex: 1;
    /* Permite que el input crezca para llenar el espacio */
    min-width: 60px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
}

.btn {
    padding: 0 30px;
    height: 50px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #40808f;
    /* Color de botones del proyecto en home.css */
    color: #fff;
    flex-grow: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #30606b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(64, 128, 143, 0.3);
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    flex-grow: 1;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
}

/* Tiendas */
.store-availability {
    background: #fdfdfd;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 30px;
}

.store-availability h3 {
    font-size: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.store-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #eee;
}

.store-item:last-child {
    border-bottom: none;
}

.store-status-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
}

.in-stock .store-status-icon {
    background: #28a745;
    box-shadow: 0 0 5px #28a745;
}

.out-of-stock .store-status-icon {
    background: #dc3545;
}

.store-name {
    flex-grow: 1;
    font-weight: 600;
    color: #444;
}

.store-qty {
    color: var(--text-muted);
}

.in-stock .store-qty {
    color: #28a745;
    font-weight: 600;
}

.out-of-stock .store-qty {
    color: #dc3545;
}

/* Tags */
.product-tags .tags-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background: var(--light-gray);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Related Products Slider */
.related-products {
    border-top: 1px solid var(--border-color);
    padding-top: 50px;
}

.related-products .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.related-products .section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 0;
    text-align: left;
    position: relative;
}

.related-products .section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    margin: 10px 0 0;
}

.related-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    padding: 10px 5px 30px;
}

.related-slider::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.related-slider .slider-item {
    flex: 0 0 calc(25% - 15px);
    /* 4 columnas en desktop */
    min-width: 280px;
}

/* Reusing slider-nav styles from home or defining here if needed */
.slider-nav {
    display: flex;
    gap: 10px;
}

.slider-nav span {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    background: #fff;
    color: var(--text-muted);
}

.slider-nav span:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Responsive */
/* Refinamiento Responsivo - Selectores Específicos para evitar conflictos */
@media screen and (max-width: 1024px) {
    .product-detail-container .product-grid {
        display: block !important;
        width: 100% !important;
    }

    .product-detail-container .product-gallery {
        position: static !important;
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto 30px !important;
        display: block !important;
    }

    .product-detail-container .product-info-section {
        width: 100% !important;
        padding: 0 15px !important;
        display: block !important;
    }

    .product-detail-container .product-header h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    .product-detail-container .product-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .product-detail-container .product-actions .quantity-selector,
    .product-detail-container .product-actions .btn {
        width: 100% !important;
    }

    .related-slider .slider-item {
        flex: 0 0 calc(50% - 10px);
        /* 2 columnas en tablets */
    }
}

@media (max-width: 576px) {
    .product-header h1 {
        font-size: 22px !important;
    }

    .current-price {
        font-size: 28px !important;
    }

    .related-slider .slider-item {
        flex: 0 0 100% !important;
    }
}