/* product page styles */
button.lightbox-close,
button.lightbox-prev,
button.lightbox-next {
    padding: 0;
    color: inherit;
    font: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
}
/* Page Header */
.page-header {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(15, 15, 15, 0.95) 100%), url('<%=siteurl%>/images/secili.jpg');
    background-size: cover;
    background-position: center;
    padding: 100px 0;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(204, 0, 0, 0.1) 0%, transparent 100%);
}

.page-header-content {
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 56px;
    font-weight: 900;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Breadcrumb */
.breadcrumb-nav {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px 0;
    border-bottom: 3px solid var(--primary-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 15px;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 15px;
}

.breadcrumb a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.breadcrumb li:not(:last-child)::after {
    content: '▸';
    color: var(--primary-color);
    font-weight: bold;
}

.breadcrumb .active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Product Section */
.product-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Product Gallery */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    width: 100%;
}

.gallery-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    display: block;
    -webkit-user-drag: none;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(204, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.gallery-overlay svg {
    width: 50px;
    height: 50px;
    fill: white;
}

.gallery-desc {
    padding: 20px;
    text-align: center;
}

.gallery-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, #990000 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Product Description */
.product-description {
    background: white;
    border-radius: 16px;
    padding: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.product-description h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
}

.product-content {
    font-size: 17px;
    line-height: 1.9;
    color: #555;
}

.product-content p {
    margin-bottom: 20px;
}

.product-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

.product-content h3, .product-content h4 {
    color: var(--secondary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 800;
}

.product-content ul, .product-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.product-content li {
    margin-bottom: 10px;
}

.product-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 0;
    margin: 0;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10001;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    padding: 40px 20px 20px;
    text-align: center;
    z-index: 10001;
}

.lightbox-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
}

/* Desktop Responsive */
@media (max-width: 1200px) {
    .product-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .page-title {
        font-size: 36px;
    }
    
    .page-header {
        padding: 60px 0;
    }
    
    .product-section {
        padding: 50px 0;
    }
    
    .product-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .gallery-image {
        height: 220px;
    }
    
    .product-description {
        padding: 30px 20px;
    }
    
    .product-description h2 {
        font-size: 28px;
    }
    
    .lightbox-prev {
        left: 15px;
        width: 50px;
        height: 50px;
    }
    
    .lightbox-next {
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .lightbox-title {
        font-size: 16px;
    }
}

/* Mobile İkişer Sütun Galerisi */
@media (max-width: 600px) {
    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 30px;
    }
    
    .gallery-image {
        height: 160px;
    }
    
    .gallery-desc {
        padding: 15px 10px;
    }
    
    .gallery-category {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .product-description {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .product-description h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .product-content {
        font-size: 14px;
    }
    
    /* Lightbox Mobil İyileştirmeleri */
    .lightbox {
        padding: 10px;
    }
    
    .lightbox-content {
        max-width: 100%;
        max-height: 70%;
    }
    
    .lightbox-content img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-prev svg,
    .lightbox-next svg {
        width: 24px;
        height: 24px;
    }
    
    .lightbox-title {
        font-size: 14px;
    }
    
    .lightbox-counter {
        font-size: 12px;
    }
}

/* Çok Küçük Mobil Cihazlar */
@media (max-width: 400px) {
    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery-image {
        height: 160px;
    }
    
    .gallery-overlay svg {
        width: 35px;
        height: 35px;
    }
}

/* Lightbox controls must remain visible above every image and global button reset. */
.lightbox {
    isolation: isolate;
}

.lightbox-content {
    position: relative;
    z-index: 1;
}

button.lightbox-close,
button.lightbox-prev,
button.lightbox-next {
    z-index: 10003;
    display: grid;
    place-items: center;
    padding: 0;
    color: #fff;
    background: rgba(17, 18, 22, .82);
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 50%;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .34), inset 0 0 0 1px rgba(226, 29, 47, .38);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

button.lightbox-close {
    position: absolute;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    width: 52px;
    height: 52px;
}

button.lightbox-prev,
button.lightbox-next {
    position: absolute;
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translateY(-50%);
}

button.lightbox-prev {
    left: max(20px, env(safe-area-inset-left));
}

button.lightbox-next {
    right: max(20px, env(safe-area-inset-right));
}

button.lightbox-close:hover,
button.lightbox-prev:hover,
button.lightbox-next:hover,
button.lightbox-close:focus-visible,
button.lightbox-prev:focus-visible,
button.lightbox-next:focus-visible {
    color: #fff;
    background: #e21d2f;
    border-color: #ff8b96;
    outline: 3px solid rgba(255, 255, 255, .7);
    outline-offset: 3px;
}

button.lightbox-close:hover {
    transform: rotate(90deg);
}

button.lightbox-prev:hover,
button.lightbox-next:hover {
    transform: translateY(-50%) scale(1.06);
}

button.lightbox-close svg,
button.lightbox-prev svg,
button.lightbox-next svg {
    display: block;
    fill: currentColor !important;
}

.lightbox-caption {
    z-index: 10002;
    pointer-events: none;
}

@media (max-width: 600px) {
    button.lightbox-close {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        width: 48px;
        height: 48px;
    }

    button.lightbox-prev,
    button.lightbox-next {
        top: auto;
        bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px));
        width: 50px;
        height: 50px;
        transform: none;
    }

    button.lightbox-prev {
        left: max(18px, env(safe-area-inset-left));
    }

    button.lightbox-next {
        right: max(18px, env(safe-area-inset-right));
    }

    button.lightbox-prev:hover,
    button.lightbox-next:hover {
        transform: scale(1.05);
    }

    .lightbox-caption {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
}

/* Stable preview stage: image proportions never resize the page or the overlay. */
.lightbox {
    inset: 0 !important;
    width: 100dvw !important;
    max-width: 100dvw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: contain;
    touch-action: none;
}

.lightbox-content {
    flex: 0 0 auto;
    width: min(90dvw, 1440px) !important;
    max-width: min(90dvw, 1440px) !important;
    height: min(78dvh, 920px) !important;
    max-height: min(78dvh, 920px) !important;
    overflow: hidden;
}

.lightbox-content img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    transform: translateZ(0);
}

@media (max-width: 600px) {
    .lightbox {
        padding:
            max(70px, env(safe-area-inset-top))
            10px
            max(122px, calc(env(safe-area-inset-bottom) + 108px)) !important;
    }

    .lightbox-content {
        width: calc(100dvw - 20px) !important;
        max-width: calc(100dvw - 20px) !important;
        height: calc(100dvh - 192px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        min-height: 220px;
        max-height: calc(100dvh - 192px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
    }

    .lightbox-content img {
        width: 100% !important;
        height: 100% !important;
    }
}
