/* ========================================
   VTEKE - Product Page Styles (Mobile Optimized)
   ======================================== */

:root {
    --red-primary: #E10600;
    --red-secondary: #C40000;
    --red-light: #ff4d4d;
    --red-pale: #fff0f0;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #666666;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #111111;
    --white: #ffffff;
    --steel-light: #f0f3f7;
    --transition: all 0.3s ease;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-red: 0 0 12px rgba(225, 6, 0, 0.15);
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-2xl: 1rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body, 'Inter', system-ui, sans-serif);
    background: #f7f7f7;
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Language Toggle */
.lang-container {
    position: fixed;
    top: 1rem; /* تصغير المسافة في الجوال */
    right: 1rem;
    z-index: 100;
    display: flex;
    background: var(--white);
    border-radius: 9999px;
    padding: 0.25rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.lang-btn {
    padding: 0.4rem 1rem; /* تصغير الأزرار قليلاً */
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.8rem;
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    /* text-transform removed — use Title Case */
    letter-spacing: 0.05em;
}

.lang-btn.active {
    background: var(--red-primary);
    color: var(--white);
}

/* Main Wrapper */
.product-details-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 1rem 2rem; /* تقليل الهوامش الجانبية للجوال */
}

/* Product Header */
.product-header {
    text-align: center;
    padding: 2rem 1.5rem;
    background: #ffffff;
    border-radius: var(--border-radius-2xl);
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

/* clean top accent line */
.product-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--red-primary);
}

.product-title {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 800;
    color: #111111;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.product-category-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    letter-spacing: 0.1em;
    color: var(--red-primary);
    margin-bottom: 16px;
}

.product-description {
    font-size: 1rem;
    color: #666666;
    max-width: 860px;
    margin: 0 auto 24px;
    font-weight: 400;
    line-height: 1.7;
}

.product-reference {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: rgba(225,6,0,0.07);
    color: var(--red-primary);
    font-weight: 500;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Image Section */
.product-image-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;                      /* allow sticky to work */
    /* Sticky floating image on desktop */
    position: sticky;
    top: 100px;
    align-self: flex-start;
    transition: box-shadow 0.3s ease;
}

.main-image-wrapper {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--white);
    cursor: pointer;
    margin-bottom: 0;
    padding: 0;
    border: 1px solid var(--gray-200);
    /* Fluid height using aspect ratio instead of fixed px */
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-wrapper:hover {
    box-shadow: var(--shadow-xl);
}

.product-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    display: block;
    margin: 0;
    padding: 0;
    background: #fff;
    transition: transform 0.5s ease;
}

.main-image-wrapper:hover .product-main-image {
    transform: scale(1.03);
}

.zoom-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(17,17,17,0.82);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.main-image-wrapper:hover .zoom-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Gallery */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
    margin-top: 0;
}

.gallery-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: none;
    background: var(--white);
    padding: 0;
    margin: 0;
    display: block;
}

.gallery-image:hover {
    filter: brightness(1.1);
    z-index: 2;
}

.gallery-image.active {
    filter: brightness(0.9);
    z-index: 2;
    outline: 2px solid var(--red-primary);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 5px;
}

.close-lightbox {
    position: absolute;
    top: -30px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* Info Section */
.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-specifications,
.technical-features,
.product-actions-section {
    background: var(--white);
    border-radius: var(--border-radius-2xl);
    padding: 2rem; /* تصغير الحشو الداخلي */
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.specs-title,
.features-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 1rem;
    /* text-transform removed */
    letter-spacing: 0.05em;
}

.specs-title i,
.features-title i {
    color: var(--red-primary);
}

/* Table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table tr {
    border-bottom: 1px solid var(--gray-200);
}

.spec-table tr:hover {
    background-color: #fafafa;
}

.spec-table td {
    padding: 1rem 0.5rem;
    font-size: 0.9rem; /* تصغير الخط قليلاً */
}

.spec-label {
    font-weight: 600;
    color: #555555;
    width: 40%;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    letter-spacing: 0.03em;
}

.spec-value {
    color: var(--gray-800);
    font-weight: 500;
}

/* Features List */
.features-list {
    list-style: none;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--border-radius-md);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--red-primary);
}

.feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #333333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-btn {
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: none;
    font-size: 0.95rem;
    /* text-transform removed */
    letter-spacing: 0.05em;
}

.primary-action {
    background: var(--red-primary);
    color: white;
}
.primary-action:hover {
    background: var(--red-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.secondary-action {
    background: white;
    color: var(--red-primary);
    border: 2px solid var(--red-primary);
}

/* Lightbox */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.image-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 90%;
    animation: lightboxZoom 0.4s ease;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 4px solid var(--white);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 45px;
    height: 45px;
    background: var(--red-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--red-secondary);
    transform: rotate(90deg) scale(1.1);
}

/* Related Products */
.related-products {
    padding: 2rem 1rem;
    background: var(--white);
    text-align: center;
    border-radius: var(--border-radius-2xl);
    margin-top: 2rem;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
    letter-spacing: 0.01em;
}

.products-slider {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.related-product-card {
    background: var(--white);
    border-radius: var(--border-radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--red-primary);
}

.related-product-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
    position: relative;
}

.related-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: var(--transition);
}

.related-product-card:hover .related-product-image img {
    transform: scale(1.08);
}

.related-product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.related-product-info h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--gray-900);
}

.related-product-info p {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    flex: 1;
}

.related-details-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--red-primary);
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.related-details-btn:hover {
    background: var(--red-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    /* Consistent card height */
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.product-card .product-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    flex-shrink: 0;
}

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

.product-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.view-details-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--red-primary);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

/* ========================================
   RESPONSIVE LAYOUT
   ======================================== */

/* Large Desktop (≥ 1200px) — default: 2-col product grid, 3-col related */

/* Laptop / Small Desktop (≥ 768px and < 1200px) */
@media (max-width: 1199px) {
    .product-details-wrapper {
        max-width: 100%;
        padding: 3rem 1.5rem 2rem;
    }
    .products-slider {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet (≥ 768px and < 1024px): stack product grid to 1 column */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }
    .main-image-wrapper {
        aspect-ratio: 16 / 9;
        max-height: 480px;
    }
    .products-slider {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .product-details-wrapper {
        padding: 2rem 0.75rem 1rem;
    }
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 8px;
    }
    /* Disable sticky on mobile — layout is single column anyway */
    .product-image-section {
        position: relative;
        top: auto;
    }
    .product-title {
        font-size: 1.8rem;
    }
    .product-description {
        font-size: 1rem;
        margin: 1rem auto;
    }
    .main-image-wrapper {
        aspect-ratio: 4 / 3;
        max-height: 360px;
    }
    .product-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
    .gallery-image {
        height: 80px;
    }
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .spec-label {
        width: 100%;
        display: block;
        margin-bottom: 0.2rem;
    }
    .spec-table td {
        display: block;
        padding: 0.5rem 0;
    }
    .products-slider {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .action-btn {
        width: 100%;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .product-header {
        padding: 1.5rem 1rem;
    }
    .product-title {
        font-size: 1.5rem;
    }
    .main-image-wrapper {
        aspect-ratio: 1 / 1;
        max-height: 300px;
    }
    .product-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-image {
        height: 80px;
    }
    .product-specifications,
    .technical-features,
    .product-actions-section {
        padding: 1.25rem;
    }
    .products-slider {
        grid-template-columns: 1fr;
    }
    .action-btn {
        width: 100%;
    }
    .related-products {
        padding: 1.5rem 0.75rem;
    }
}