/*
 * Estilos de las paginas de producto y del visor de imagenes.
 *
 * Estaban en un <style> en linea dentro de templates/macros/main.html.twig, lo
 * que obligaba a mantener 'unsafe-inline' en style-src.
 */

/* Estilos personalizados para páginas de productos */
.page-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.content-section {
    padding: 30px 0 30px 0;
    background: #f8f9fa;
}

.content-section:nth-child(even) {
    background: white;
}

.section-title {
    color: #0056b3;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
}

.product-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,123,255,0.1);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(0,123,255,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,123,255,0.2);
}

.product-card h3 {
    color: #0056b3;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.product-card p {
    color: #666;
    line-height: 1.6;
}

.product-image {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.feature-list {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    border-left: 5px solid #007bff;
}

.feature-list ul {
    margin: 0;
    padding-left: 20px;
}

.feature-list li {
    color: #0056b3;
    margin-bottom: 8px;
    font-weight: 500;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.4);
    color: white;
    text-decoration: none;
}

.specification-box {
    background: white;
    border: 2px solid #007bff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.specification-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 10px;
    z-index: -1;
    opacity: 0.1;
}

.specification-box h4 {
    color: #0056b3;
    font-weight: 600;
    margin-bottom: 15px;
}

.image-gallery {
    display: grid;
    gap: 20px;
    margin: 30px 0;
}

.image-gallery img {
    width: 100%;
    height: 450px; /* increased default height for better proportions */
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* Gallery variants */
.image-gallery.cols-1 {
    grid-template-columns: 1fr;
}
.image-gallery.cols-2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr; /* Ensure single row for 2 images */
}
.image-gallery.cols-3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr; /* Ensure single row for 3 images */
}
/* For 4-image galleries and more, use 2x2 grid or 2 columns with auto rows */
.image-gallery.cols-2-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr; /* Allow automatic row creation */
}
/* Ensure proper spacing and alignment */
.image-gallery-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure gallery blocks expand to full container width when used in mixed column layouts */
.image-gallery {
    width: 100%;
    max-width: none;
}

/* Custom alternating 2-3 layout */
.image-gallery.custom-alternating-2-3 .gallery-row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.image-gallery.custom-alternating-2-3 .row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.image-gallery.custom-alternating-2-3 .row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.image-gallery.custom-2-3 .large img {
    height: 380px;
}

.image-gallery.custom-2-3 .small img {
    height: 300px;
}

/* Product-card variants */
.product-card--full {
    width: 100%;
    max-width: none;
    padding: 40px;
    box-sizing: border-box;
}
.product-card--with-image .product-image--side {
    max-width: 100%;
    height: auto;
}

/* Ensure product-card stretches visually when used inside narrower columns: allow negative margins to escape small cols */
.product-card.product-card--full {
    /* allow the full product card to visually span the container; safe fallback if --content-gutter isn't set */
    margin-left: calc(-1 * var(--content-gutter, 0px));
    margin-right: calc(-1 * var(--content-gutter, 0px));
}

.content-section h3 {
    color: #0056b3;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.content-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
}

/* Estilos para breadcrumbs */
#inner-title {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 0;
}

#inner-title .inner-title-content h2 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#inner-title .breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 8px 20px;
    display: inline-block;
    margin: 0;
}

#inner-title .breadcrumb li {
    display: inline-block;
    font-size: 14px;
}

#inner-title .breadcrumb li a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 15px;
    transition: background-color 0.3s ease;
}

#inner-title .breadcrumb li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

#inner-title .breadcrumb li:not(:last-child)::after {
    content: '/';
    color: rgba(255, 255, 255, 0.7);
    margin: 0 10px;
}

@media (max-width: 768px) {
    .gallery-nav-prev {
        left: -60px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .gallery-nav-next {
        right: -60px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .gallery-popup-counter {
        bottom: -40px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Gallery Popup Styles */
.gallery-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.gallery-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.gallery-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 5% auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-popup-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-popup-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gallery-popup-close:hover {
    background: white;
    transform: scale(1.1);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.gallery-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev {
    left: -75px;
}

.gallery-nav-next {
    right: -75px;
}

.gallery-popup-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.gallery-thumbnails {
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.gallery-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.gallery-thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.gallery-thumbnail.active {
    border-color: #007bff;
    opacity: 1;
    transform: scale(1.05);
}

.gallery-image {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Gallery Popup Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.gallery-popup.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.gallery-popup.show .gallery-popup-content {
    animation: zoomIn 0.3s ease;
}

