/**
 * Product Pages Styles - Windows, Doors, etc.
 * My Best Windows & Glass Child Theme
 */

/* ========================================
   PRODUCT PAGE WRAPPER
   ======================================== */
.bwg-product-page-wrapper {
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   PRODUCT HERO
   ======================================== */
.bwg-product-hero {
    background: linear-gradient(135deg, var(--bwg-primary) 0%, var(--bwg-secondary) 100%);
    padding: 100px 0 80px;
    color: #ffffff;
    text-align: center;
    position: relative;
}

.bwg-product-hero .bwg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.bwg-product-hero-content h1 {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.bwg-product-subtitle {
    font-size: 22px;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.bwg-product-hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   PRODUCT OVERVIEW
   ======================================== */
.bwg-product-overview {
    padding: 80px 0;
    background: #ffffff;
    position: relative;
}

.bwg-product-overview .bwg-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.bwg-product-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 60px;
}

.bwg-product-intro h2 {
    font-size: 42px;
    font-weight: 700;
    color: var(--bwg-primary);
    margin-bottom: 20px;
}

.bwg-product-intro-text {
    font-size: 18px;
    color: var(--bwg-text);
    line-height: 1.8;
}

.bwg-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.bwg-benefit-item {
    text-align: center;
    padding: 30px;
    background: var(--bwg-light-gray);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bwg-benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.15);
}

.bwg-benefit-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.bwg-benefit-item h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--bwg-primary);
    margin-bottom: 15px;
}

.bwg-benefit-item p {
    color: var(--bwg-text);
    line-height: 1.6;
    font-size: 16px;
}

/* ========================================
   PRODUCT GALLERY
   ======================================== */
.bwg-product-gallery {
    padding: 80px 0;
    background: var(--bwg-light-gray);
    position: relative;
}

.bwg-product-gallery .bwg-container {
    max-width: 1600px;
    padding: 0 40px;
    width: 100%;
}

.bwg-gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.bwg-gallery-header h2 {
    font-size: 42px;
    font-weight: 700;
    color: var(--bwg-primary);
    margin-bottom: 15px;
}

.bwg-gallery-header p {
    font-size: 18px;
    color: var(--bwg-text);
}

.bwg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 250px;
    gap: 15px;
    margin-top: 40px;
    width: 100%;
}

.bwg-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Create varied sizes for a dynamic masonry-style gallery layout */
/* Every 3rd item starting from 1st is taller */
.bwg-gallery-item:nth-child(3n+1) {
    grid-row: span 2;
    min-height: 515px;
}

/* Some items get medium height for variety */
.bwg-gallery-item:nth-child(5n+2) {
    grid-row: span 1;
    min-height: 250px;
}

/* Occasional taller items for visual interest */
.bwg-gallery-item:nth-child(7n+4) {
    grid-row: span 2;
    min-height: 530px;
}

/* Ensure items fill space better */
.bwg-gallery-item {
    width: 100%;
    height: 100%;
}

.bwg-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.2);
}

.bwg-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    min-height: 250px;
}

.bwg-gallery-item:hover img {
    transform: scale(1.05);
}

.bwg-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #ffffff;
    padding: 15px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(10px);
}

.bwg-gallery-item:hover .bwg-gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

.bwg-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 102, 204, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bwg-gallery-item:hover .bwg-gallery-overlay {
    opacity: 1;
}

.bwg-gallery-view {
    background: #ffffff;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bwg-primary);
    transition: transform 0.3s ease;
}

.bwg-gallery-view:hover {
    transform: scale(1.1);
}

/* Gallery Placeholder */
.bwg-gallery-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px dashed var(--bwg-border);
}

.bwg-placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.bwg-gallery-placeholder p {
    font-size: 18px;
    color: var(--bwg-text);
    margin-bottom: 10px;
}

.bwg-placeholder-note {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Hidden gallery items (for show more feature) */
.bwg-gallery-hidden {
    display: none;
}

.bwg-gallery-item.bwg-gallery-hidden.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

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

/* Load More Button */
.bwg-gallery-load-more-wrapper {
    text-align: center;
    margin-top: 50px;
}

.bwg-gallery-load-more {
    background: var(--bwg-primary);
    color: #ffffff;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bwg-gallery-load-more:hover {
    background: var(--bwg-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
}

.bwg-gallery-load-more:active {
    transform: translateY(0);
}

.bwg-gallery-load-more.hidden {
    display: none;
}

.bwg-load-more-count {
    font-size: 14px;
    opacity: 0.9;
}

/* Gallery Lightbox */
.bwg-gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.bwg-gallery-lightbox.active {
    display: flex;
}

.bwg-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.bwg-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.bwg-lightbox-close,
.bwg-lightbox-prev,
.bwg-lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--bwg-primary);
    font-size: 36px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 10000;
}

.bwg-lightbox-close:hover,
.bwg-lightbox-prev:hover,
.bwg-lightbox-next:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.bwg-lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 42px;
    line-height: 1;
}

.bwg-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.bwg-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* ========================================
   PRODUCT FEATURES
   ======================================== */
.bwg-product-features {
    padding: 80px 0;
    background: #ffffff;
    position: relative;
}

.bwg-features-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.bwg-features-text h2 {
    font-size: 42px;
    font-weight: 700;
    color: var(--bwg-primary);
    margin-bottom: 30px;
}

.bwg-features-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bwg-feature-row {
    display: flex;
    padding: 20px;
    background: var(--bwg-light-gray);
    border-radius: 6px;
    border-left: 4px solid var(--bwg-primary);
}

.bwg-feature-label {
    font-weight: 600;
    color: var(--bwg-primary);
    min-width: 180px;
}

.bwg-feature-value {
    color: var(--bwg-text);
    flex: 1;
}

.bwg-features-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bwg-feature-visual {
    text-align: center;
    padding: 60px;
    background: linear-gradient(135deg, var(--bwg-primary) 0%, var(--bwg-secondary) 100%);
    border-radius: 12px;
    color: #ffffff;
}

.bwg-visual-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.bwg-feature-visual p {
    font-size: 20px;
    font-weight: 600;
}

/* ========================================
   IMPROVED PRODUCT FEATURES (Windows Page)
   ======================================== */
.bwg-product-features-improved {
    padding: 100px 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
    /* Fallback background color if image doesn't load */
    background-color: var(--bwg-secondary);
}

.bwg-features-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.85) 0%, rgba(0, 61, 122, 0.9) 100%);
    z-index: 1;
}

.bwg-features-improved-content {
    position: relative;
    z-index: 2;
}

.bwg-features-header-improved {
    text-align: center;
    margin-bottom: 60px;
}

.bwg-features-header-improved h2 {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.bwg-features-header-improved p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95);
    max-width: 600px;
    margin: 0 auto;
}

.bwg-features-grid-improved {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.bwg-feature-card-improved {
    background: rgba(255, 255, 255, 0.95);
    padding: 35px;
    border-radius: 12px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.bwg-feature-card-improved:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.bwg-feature-icon-improved {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bwg-primary) 0%, var(--bwg-secondary) 100%);
    border-radius: 12px;
    padding: 10px;
}

.bwg-feature-content-improved {
    flex: 1;
}

.bwg-feature-label-improved {
    font-size: 20px;
    font-weight: 700;
    color: var(--bwg-primary);
    margin-bottom: 10px;
    margin-top: 0;
}

.bwg-feature-value-improved {
    font-size: 16px;
    color: var(--bwg-text);
    line-height: 1.6;
    margin: 0;
}

/* Responsive for improved features */
@media (max-width: 968px) {
    .bwg-product-features-improved {
        padding: 80px 0;
        background-attachment: scroll;
    }
    
    .bwg-features-header-improved h2 {
        font-size: 36px;
    }
    
    .bwg-features-grid-improved {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .bwg-product-features-improved {
        padding: 50px 0;
        background-attachment: scroll;
    }
    
    .bwg-features-improved-content {
        padding: 0 15px;
    }
    
    .bwg-features-header-improved {
        margin-bottom: 35px;
        padding: 0 10px;
    }
    
    .bwg-features-header-improved h2 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .bwg-features-header-improved p {
        font-size: 16px;
        line-height: 1.5;
        padding: 0 5px;
    }
    
    .bwg-features-grid-improved {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 30px;
        padding: 0 5px;
    }
    
    .bwg-feature-card-improved {
        padding: 22px 18px;
        flex-direction: row;
        text-align: left;
        gap: 15px;
        align-items: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    }
    
    .bwg-feature-card-improved:hover {
        transform: none;
    }
    
    .bwg-feature-icon-improved {
        width: 55px;
        height: 55px;
        margin: 0;
        font-size: 32px;
        flex-shrink: 0;
        padding: 8px;
    }
    
    .bwg-feature-content-improved {
        flex: 1;
        min-width: 0;
    }
    
    .bwg-feature-label-improved {
        font-size: 17px;
        margin-bottom: 8px;
        line-height: 1.4;
    }
    
    .bwg-feature-value-improved {
        font-size: 14px;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .bwg-product-features-improved {
        padding: 40px 0;
    }
    
    .bwg-features-header-improved {
        margin-bottom: 30px;
        padding: 0 5px;
    }
    
    .bwg-features-header-improved h2 {
        font-size: 24px;
        line-height: 1.3;
        margin-bottom: 10px;
    }
    
    .bwg-features-header-improved p {
        font-size: 15px;
        line-height: 1.4;
    }
    
    .bwg-features-grid-improved {
        gap: 15px;
        margin-top: 25px;
        padding: 0;
    }
    
    .bwg-feature-card-improved {
        padding: 18px 15px;
        gap: 12px;
        border-radius: 10px;
    }
    
    .bwg-feature-icon-improved {
        width: 50px;
        height: 50px;
        font-size: 28px;
        padding: 6px;
        border-radius: 10px;
    }
    
    .bwg-feature-label-improved {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .bwg-feature-value-improved {
        font-size: 13px;
        line-height: 1.5;
    }
}

/* ========================================
   PRODUCT TYPES
   ======================================== */
.bwg-product-types {
    padding: 80px 0;
    background: var(--bwg-light-gray);
    position: relative;
}

.bwg-types-header {
    text-align: center;
    margin-bottom: 50px;
}

.bwg-types-header h2 {
    font-size: 42px;
    font-weight: 700;
    color: var(--bwg-primary);
    margin-bottom: 15px;
}

.bwg-types-header p {
    font-size: 18px;
    color: var(--bwg-text);
    max-width: 700px;
    margin: 0 auto;
}

.bwg-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.bwg-type-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.bwg-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.15);
    border-color: var(--bwg-primary);
}

.bwg-type-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.bwg-type-image {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bwg-light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bwg-type-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bwg-type-card:hover .bwg-type-image img {
    transform: scale(1.05);
}

/* Responsive image sizing */
@media (max-width: 768px) {
    .bwg-type-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .bwg-type-image {
        height: 160px;
    }
}

.bwg-type-card h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--bwg-primary);
    margin-bottom: 15px;
}

.bwg-type-card p {
    color: var(--bwg-text);
    line-height: 1.7;
    font-size: 16px;
}

/* ========================================
   PRODUCT CTA
   ======================================== */
.bwg-product-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--bwg-primary) 0%, var(--bwg-secondary) 100%);
    color: #ffffff;
    text-align: center;
    position: relative;
}

.bwg-cta-content h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
}

.bwg-cta-content > p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.bwg-cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.bwg-cta-buttons .bwg-button-primary {
    background: #ffffff;
    color: var(--bwg-primary);
}

.bwg-cta-buttons .bwg-button-secondary {
    border-color: #ffffff;
    color: #ffffff;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet and below (968px) */
@media (max-width: 968px) {
    .bwg-product-hero-content h1 {
        font-size: 42px;
    }
    
    .bwg-product-subtitle {
        font-size: 20px;
    }
    
    .bwg-features-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .bwg-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        grid-auto-rows: 280px;
        gap: 15px;
    }
    
    .bwg-product-gallery .bwg-container {
        padding: 0 30px;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    .bwg-product-hero {
        padding: 60px 0 50px;
    }
    
    .bwg-product-hero-content h1 {
        font-size: 36px;
    }
    
    .bwg-product-subtitle {
        font-size: 18px;
    }
    
    .bwg-product-hero-buttons,
    .bwg-cta-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .bwg-product-hero-buttons .bwg-button-primary,
    .bwg-product-hero-buttons .bwg-button-secondary,
    .bwg-cta-buttons .bwg-button-primary,
    .bwg-cta-buttons .bwg-button-secondary {
        width: 100%;
    }
    
    .bwg-product-overview,
    .bwg-product-gallery,
    .bwg-product-features,
    .bwg-product-types,
    .bwg-product-cta {
        padding: 60px 0;
    }
    
    .bwg-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
        gap: 15px;
    }
    
    .bwg-product-gallery .bwg-container {
        padding: 0 20px;
    }
    
    /* Reset varied sizes on mobile for simpler layout */
    .bwg-gallery-item:nth-child(n) {
        grid-row: span 1;
        min-height: 300px;
    }
    
    .bwg-product-intro h2,
    .bwg-gallery-header h2,
    .bwg-features-text h2,
    .bwg-types-header h2,
    .bwg-cta-content h2 {
        font-size: 32px;
    }
    
    .bwg-benefits-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .bwg-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .bwg-types-grid {
        grid-template-columns: 1fr;
    }
    
    .bwg-feature-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .bwg-feature-label {
        min-width: auto;
    }
    
    .bwg-lightbox-prev,
    .bwg-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .bwg-lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 32px;
        top: 10px;
        right: 10px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .bwg-product-hero-content h1 {
        font-size: 28px;
    }
    
    .bwg-product-intro h2,
    .bwg-gallery-header h2,
    .bwg-features-text h2,
    .bwg-types-header h2,
    .bwg-cta-content h2 {
        font-size: 28px;
    }
    
    .bwg-feature-visual {
        padding: 40px 30px;
    }
    
    .bwg-visual-icon {
        font-size: 60px;
    }
}

