/* --- Product Detail Section Styles --- */
.product-detail-section {
    padding: 2rem 0 4rem 0;
    background: #f8fafc;
}

.product-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.product-main-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.product-images {
    margin-bottom: 2rem;
}

.main-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #ffffff;
}

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

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

.thumbnail-images {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}

.thumbnail.active {
    border-color: #2563eb;
}

.thumbnail:hover {
    border-color: #3b82f6;
}

.product-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.product-description {
    margin-bottom: 2rem;
}

.product-description p {
    font-size: 1.1rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.content-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.content-section:last-child {
    border-bottom: none;
    margin-bottom: 2rem;
}

.section-heading {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.section-heading::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: #2563eb;
    margin-right: 0.75rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.content-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.content-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    padding-left: 1.5rem;
}

.content-list li:last-child {
    border-bottom: none;
}

.content-list li::before {
    content: '•';
    color: #2563eb;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: 0.75rem;
}

.equipment-list li::before {
    content: '⚙';
    color: #059669;
}

.equipment-specs {
    display: grid;
    gap: 1.5rem;
}

.equipment-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.equipment-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.equipment-spec {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.component-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.3s ease;
}

.component-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.component-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.component-description {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.product-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

/* --- Downloads Section --- */
.downloads-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.download-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.download-tabs::-webkit-scrollbar {
    display: none;
}

.download-tab {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
}

.download-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #f8fafc;
}

.download-tab:hover {
    color: #2563eb;
    background: #f8fafc;
}

.download-content {
    position: relative;
}

.download-panel {
    display: none;
}

.download-panel.active {
    display: block;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    gap: 1rem;
}

.download-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.download-title {
    font-size: 1rem;
    font-weight: 500;
    color: #1e293b;
    word-wrap: break-word;
}

.language-flags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.flag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #2563eb;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.flag.en { background: #dc2626; }
.flag.fr { background: #2563eb; }
.flag.es { background: #ea580c; }
.flag.de { background: #1f2937; }

.download-btn, .enquiry-btn {
    background: #16a34a;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 44px;
    flex-shrink: 0;
}

.download-btn:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.enquiry-btn {
    background: #2563eb;
}

.enquiry-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.no-files {
    text-align: center;
    padding: 3rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.no-files p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* --- Related Products Grid --- */
.simple-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.simple-product-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.simple-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.simple-card-image {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.simple-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-card-content {
    padding: 1.5rem;
}

.simple-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.simple-card-button {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.simple-card-button:hover {
    background: #1d4ed8;
}

/* --- Section Images --- */
.section-image {
    margin: 1.5rem 0;
    text-align: center;
}

.section-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.section-paragraph {
    margin-bottom: 1.5rem;
}

.section-paragraph p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.7;
    margin: 0;
}

/* --- Sidebar (Similar Products) --- */
.product-sidebar {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-content {
    padding: 2rem;
}

.sidebar-heading {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.similar-products {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.similar-product-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.similar-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.similar-product-image {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #ffffff;
}

.similar-product-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.similar-product-info {
    padding: 1rem;
}

.similar-product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.similar-product-description {
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.similar-product-link {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.similar-product-link:hover {
    background: #1d4ed8;
}

.no-similar-products {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

/* --- Responsive Design --- */

/* Large screens - better container handling */
@media (max-width: 1400px) {
    .product-detail-wrapper {
        max-width: 100%;
        padding: 0 1.5rem;
    }
}

/* Tablet Landscape */
@media (max-width: 1200px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
    
    .product-title {
        font-size: 2rem;
    }
}

/* Tablet Portrait */
@media (max-width: 1024px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-sidebar {
        position: static;
        top: auto;
        order: 2;
    }
    
    .similar-products {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .components-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .simple-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .product-detail-wrapper {
        padding: 0 1rem;
    }
    
    .product-main-content {
        padding: 1.5rem;
    }
    
    .sidebar-content {
        padding: 1.5rem;
    }
    
    .product-title {
        font-size: 1.8rem;
    }
    
    .main-image {
        height: 300px;
    }
    
    .components-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .simple-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .similar-products {
        grid-template-columns: 1fr;
    }
    
    .download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .download-btn, .enquiry-btn {
        width: 100%;
        text-align: center;
    }
    
    .equipment-specs {
        gap: 1rem;
    }
    
    .equipment-item {
        padding: 1rem;
    }
    
    .component-item {
        padding: 1rem;
    }
    
    .section-heading {
        font-size: 1.3rem;
        flex-wrap: wrap;
    }
    
    .section-heading::before {
        height: 1.3rem;
    }
    
    .product-description p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .product-detail-section {
        padding: 1rem 0 2rem 0;
    }
    
    .product-detail-wrapper {
        padding: 0 0.75rem;
    }
    
    .product-main-content {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .sidebar-content {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .main-image {
        height: 250px;
    }
    
    .thumbnail {
        width: 70px;
        height: 50px;
    }
    
    .thumbnail-images {
        gap: 0.25rem;
        padding: 0.25rem 0;
    }
    
    .section-heading {
        font-size: 1.2rem;
    }
    
    .sidebar-heading {
        font-size: 1.2rem;
    }
    
    .content-list li {
        padding: 0.5rem 0;
        padding-left: 1.2rem;
        font-size: 0.95rem;
    }
    
    .content-list li::before {
        font-size: 1rem;
        top: 0.5rem;
    }
    
    .download-tabs {
        margin-bottom: 1rem;
    }
    
    .download-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .similar-product-image {
        height: 120px;
    }
    
    .similar-product-title {
        font-size: 0.95rem;
    }
    
    .similar-product-description {
        font-size: 0.8rem;
    }
    
    .equipment-name, .component-name {
        font-size: 1rem;
    }
    
    .equipment-spec, .component-description {
        font-size: 0.9rem;
    }
    
    .simple-card-image {
        height: 180px;
    }
    
    .simple-card-content {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .content-section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .product-detail-wrapper {
        padding: 0 0.5rem;
    }
    
    .product-main-content {
        padding: 0.75rem;
    }
    
    .sidebar-content {
        padding: 0.75rem;
    }
    
    .main-image {
        height: 200px;
    }
    
    .product-title {
        font-size: 1.3rem;
    }
    
    .download-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .thumbnail {
        width: 60px;
        height: 40px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn, .download-btn, .enquiry-btn, .download-tab, .similar-product-link, .simple-card-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .thumbnail {
        min-width: 44px;
        min-height: 44px;
    }
    
    .main-image img:hover,
    .component-item:hover,
    .similar-product-card:hover,
    .simple-product-card:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover,
    .download-btn:hover,
    .enquiry-btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .main-image img,
    .similar-product-image img,
    .simple-card-image img,
    .section-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation specific fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .product-detail-section {
        padding: 1rem 0 2rem 0;
    }
    
    .main-image {
        height: 200px;
    }
    
    .product-sidebar {
        position: static;
    }
}

/* Print styles */
@media print {
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-sidebar {
        display: none;
    }
    
    .download-tabs,
    .download-content,
    .product-actions {
        display: none;
    }
    
    .main-image {
        height: auto;
        max-height: 300px;
    }
    
    .product-main-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
