.product-detail-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    min-height: calc(100vh - 80px);
    background-color: var(--background, #f8f9fa);
}

/* Dark mode support */
body.dark .product-detail-main {
    background-color: var(--background, #1a1a1a);
}

body.dark .image-carousel {
    background: var(--card-bg, #2d2d2d);
}

body.dark .main-image {
    background: var(--card-bg, #2d2d2d);
}

body.dark .product-description,
body.dark .seller-info,
body.dark .comment-form,
body.dark .comment {
    background: var(--card-bg, #2d2d2d);
    border-color: var(--border-color, #404040);
}

body.dark .product-category,
body.dark .product-sizes {
    background: var(--card-bg, #2d2d2d);
    border-color: var(--border-color, #404040);
    color: var(--text-color, #ffffff);
}

body.dark .quantity-input {
    background: var(--card-bg, #2d2d2d);
    border-color: var(--border-color, #404040);
    color: var(--text-color, #ffffff);
}

body.dark .like-button {
    background: var(--card-bg, #2d2d2d);
    border-color: var(--border-color, #404040);
    color: var(--text-color, #ffffff);
}

body.dark .comment-form textarea {
    background: var(--body-color, #1a1a1a);
    border-color: var(--border-color, #404040);
    color: var(--text-color, #ffffff);
}

body.dark .no-comments {
    background: var(--card-bg, #2d2d2d);
    border-color: var(--border-color, #404040);
    color: var(--text-color-light, #b0b0b0);
}

/* Sección de Imágenes */
.product-images-section {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.image-carousel {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background: var(--card-bg, #ffffff);
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background: var(--card-bg, #ffffff);
}

.main-image.active {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 15px;
}

.next-btn {
    right: 15px;
}

.image-indicators {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active,
.indicator:hover {
    background: var(--primary-color, #4361ee);
    transform: scale(1.2);
}

/* Información del Producto */
.product-info-section {
    width: 100%;
    max-width: 800px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}


.product-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.product-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color, #2b2d42);
    margin: 0;
    line-height: 1.2;
}

.product-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-color, #4361ee);
    margin: 0;
}

.product-meta {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.product-category,
.product-sizes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg, #ffffff);
    border: 2px solid var(--border-color, #e9ecef);
    border-radius: 25px;
    font-weight: 600;
    color: var(--text-color, #2b2d42);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Sizes selector styles */
.sizes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    justify-content: center;
}

.size-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.size-option input[type="checkbox"] {
    appearance: none;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    position: absolute;
    opacity: 0;
}

.size-option span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #2b2d42);
    font-weight: 600;
    transition: all 0.2s ease;
}

.size-option:hover span {
    border-color: var(--primary-color, #4361ee);
}

.size-option input[type="checkbox"]:checked + span {
    background: var(--primary-color, #4361ee);
    color: #fff;
    border-color: var(--primary-color, #4361ee);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

/* Dark mode for size chips */
body.dark .size-option span {
    background: var(--card-bg, #2d2d2d);
    border-color: var(--border-color, #404040);
    color: var(--text-color, #ffffff);
}
body.dark .size-option input[type="checkbox"]:checked + span {
    background: var(--primary-color, #4361ee);
    color: #fff;
    border-color: var(--primary-color, #4361ee);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.25);
}

.product-category i,
.product-sizes i {
    color: var(--primary-color, #4361ee);
}

.product-description {
    background: var(--card-bg, #ffffff);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color, #e9ecef);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.product-description h3 {
    color: var(--primary-color, #4361ee);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-description p {
    line-height: 1.7;
    color: var(--text-color, #2b2d42);
    margin: 0;
    font-size: 1.1rem;
}

/* Clamp de 5 líneas con opción de expandir */
.product-description .desc-collapsed {
    /* Line clamp (Chromium/WebKit) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    /* Spec draft (some browsers): */
    line-clamp: 5;
    /* Fallback: cap height roughly to 5 lines (line-height is 1.7) */
    max-height: calc(1.7 * 5 * 1em);
    overflow: hidden;
}
.product-description .desc-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}
.btn-toggle-descripcion {
    margin-top: 10px;
    background: var(--primary-color, #4361ee);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-toggle-descripcion:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.seller-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    border: 1px solid var(--border-color, #e9ecef);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    font-weight: 600;
    color: var(--text-color, #2b2d42);
}

.seller-info a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-color, #4361ee);
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.seller-info a:hover {
    background: rgba(67, 97, 238, 0.1);
    transform: translateY(-2px);
}

.seller-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 3px solid var(--primary-color, #4361ee);
    object-fit: cover;
}

/* Acciones del Producto */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    width: 100%;
}

.stock-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.stock-info:not(.out-of-stock) {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 2px solid #28a745;
}

.stock-info.out-of-stock {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 2px solid #dc3545;
}

.stock-info i {
    font-size: 1.2rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.quantity-selector label {
    font-weight: 600;
    color: var(--text-color, #2b2d42);
    font-size: 1.1rem;
}

.quantity-input {
    width: 100px;
    padding: 0.75rem;
    border-radius: 12px;
    border: 2px solid var(--border-color, #e9ecef);
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #2b2d42);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    border-color: var(--primary-color, #4361ee);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cart,
.btn-buy {
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-cart {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-buy {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.btn-cart:hover,
.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-cart:disabled,
.btn-buy:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.like-form {
    margin-top: 1rem;
}

.like-button {
    background: none;
    border: 2px solid var(--border-color, #e9ecef);
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color, #2b2d42);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    background: var(--card-bg, #ffffff);
}

.like-button:hover {
    border-color: var(--primary-color, #4361ee);
    color: var(--primary-color, #4361ee);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.like-button .fa-solid {
    color: #dc3545;
}

/* Sección de Comentarios */
.comments-section {
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
}

.comments-section h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color, #2b2d42);
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.comments-section h3 i {
    color: var(--primary-color, #4361ee);
}

.comment-form {
    background: var(--card-bg, #ffffff);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color, #e9ecef);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color, #e9ecef);
    border-radius: 12px;
    background: var(--body-color, #f8f9fa);
    color: var(--text-color, #2b2d42);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    margin-bottom: 1rem;
}

.comment-form textarea:focus {
    border-color: var(--primary-color, #4361ee);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.btn-comment {
    background: linear-gradient(135deg, var(--primary-color, #4361ee), #3a56d4);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.btn-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.3);
}

.comments-list {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    border: 1px solid var(--border-color, #e9ecef);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.comment-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #e9ecef);
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-header strong {
    color: var(--primary-color, #4361ee);
    font-weight: 600;
    font-size: 1.1rem;
}

.comment-header small {
    color: var(--text-color-light, #6c757d);
    font-size: 0.9rem;
}

.comment-content p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color, #2b2d42);
    font-size: 1rem;
}

.no-comments {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-color-light, #6c757d);
    background: var(--card-bg, #ffffff);
    border-radius: 16px;
    border: 1px solid var(--border-color, #e9ecef);
}

.no-comments i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-comments p {
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-detail-main {
        padding: 120px 1.5rem 2rem 1.5rem;
        gap: 2.5rem;
    }
    
    .product-header h1 {
        font-size: 2.2rem;
    }
    
    .product-price {
        font-size: 2rem;
    }
    
    .image-carousel {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .product-images-section{
        margin-top: 50px;
    }
}

@media (max-width: 480px) {
    .product-detail-main {
        padding: 100px 0.75rem 1rem 0.75rem;
        gap: 1.5rem;
    }
    
    .product-header h1 {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.4rem;
    }
    
    .image-carousel {
        height: 250px;
    }
    
    .product-description,
    .seller-info,
    .comment-form {
        padding: 1.5rem;
    }
    
    .quantity-selector {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .comment {
        padding: 1rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
