/* === CSS Variables === */
:root {
    --primary: #1A237E;
    --secondary: #FB6D00;
    --text-dark: #14213B;
    --text-main: #1B1B21;
    --text-light: #757575;
    --text-muted: #767683;
    --bg-light: #F5F2FB;
    --bg-white: #FBF8FF;
    --border-color: #C6C5D4;
    --border-light: #E4E1EA;
    --success: #4CAF50;
    --price-color: #9E4200;
    --primary-text: #000666;
    --transition: 0.3s ease;
}

/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cairo', sans-serif; color: var(--text-main); background: #FFFCFC; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
html[dir="ltr"] { direction: ltr; text-align: left; }

/* === Buttons === */
.btn { padding: 8px 24px; border-radius: 8px; font-family: 'Cairo'; font-weight: 500; font-size: 16px; cursor: pointer; transition: var(--transition); border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background-color: var(--secondary); color: white; border-color: var(--secondary); }
.btn-primary:hover { background-color: #e65100; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background-color: var(--primary); color: white; }
.btn-outline-block { width: 100%; background: transparent; color: var(--primary); border-color: var(--primary); padding: 8px; border-radius: 8px; font-family: 'Cairo'; font-weight: 700; cursor: pointer; transition: var(--transition); text-align: center; }
.btn-outline-block:hover { background-color: var(--primary); color: white; }
.btn-outline-icon { background: transparent; color: var(--text-main); border-color: var(--text-muted); padding: 12px 24px; }
.btn-outline-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { font-size: 20px; padding: 16px 0; }

/* === Header === */
.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo img {
    height: 50px;
    object-fit: contain;
}

.main-nav ul {
    display: flex;
    gap: 32px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-main);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.main-nav a.active, .main-nav a:hover {
    color: var(--text-dark);
    border-bottom-color: var(--secondary);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-toggle {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Cairo';
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
}

/* === Breadcrumbs === */
.breadcrumbs { padding: 24px 0; border-bottom: 1px solid var(--border-light); }
.breadcrumb-list { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.breadcrumb-list li a { color: var(--text-light); }
.breadcrumb-list li a:hover { color: var(--primary); }
.breadcrumb-list li.active { color: var(--text-main); font-weight: 600; }
.breadcrumb-list li i { font-size: 10px; color: var(--text-light); }

/* === Product Detail Grid === */
.product-detail-main { padding: 48px 0; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }

/* Product Info */
.product-meta-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ref-number { color: var(--primary-text); font-weight: 700; font-size: 14px; letter-spacing: 0.5px; }
.badge.verified { background: var(--success); color: white; padding: 4px 12px; border-radius: 20px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.product-title { font-size: 32px; color: var(--text-dark); line-height: 1.3; margin-bottom: 16px; }
.product-category-company { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; font-size: 16px; }
.category { color: var(--text-light); }
.dot { width: 4px; height: 4px; background: var(--border-color); border-radius: 50%; }
.company-link { color: var(--primary); font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* Pricing Card */
.pricing-card { background: var(--bg-light); border: 1px solid var(--border-light); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.pricing-card h3 { font-size: 18px; margin-bottom: 16px; }
.price-tier { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: white; border: 1px solid var(--border-light); border-radius: 8px; margin-bottom: 12px; }
.price-tier.featured { border: 1px solid rgba(26, 35, 126, 0.3); }
.price-amount .price { font-size: 20px; font-weight: 700; color: var(--primary-text); display: block; }
.price-amount .label { font-size: 12px; color: var(--text-light); }
.range-text { font-size: 14px; font-weight: 600; color: var(--text-main); }
.discount-badge { display: block; font-size: 12px; font-weight: 700; color: var(--success); }
.moq-section { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; font-size: 14px; }
.moq-icon { color: var(--success); }
.action-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-contact { width: 100%; justify-content: center; }
.secondary-actions { display: flex; gap: 12px; }
.secondary-actions .btn-outline-icon { flex: 1; justify-content: center; }

/* Specs Table */
.specs-card { background: white; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.specs-header { background: var(--bg-light); padding: 12px 24px; border-bottom: 1px solid var(--border-light); }
.specs-header h3 { font-size: 16px; font-weight: 400; }
.spec-row { display: flex; border-bottom: 1px solid var(--border-light); }
.spec-row:last-child { border-bottom: none; }
.spec-label { width: 35%; padding: 12px 16px; font-weight: 600; font-size: 14px; color: var(--text-main); background: white; border-left: 1px solid var(--border-light); }
html[dir="ltr"] .spec-label { border-left: none; border-right: 1px solid var(--border-light); }
.spec-value { width: 65%; padding: 12px 16px; font-size: 14px; color: var(--text-light); }

/* Gallery */
.product-gallery { display: flex; flex-direction: column; gap: 16px; }
.main-image-container { background: white; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); overflow: hidden; height: 500px; }
.main-image-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.main-image-container:hover img { transform: scale(1.02); }
.thumbnail-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.thumbnail { height: 120px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; position: relative; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail.active, .thumbnail:hover { border-color: var(--primary); }
.thumbnail.has-overlay::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }
.overlay-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-size: 18px; font-weight: 700; z-index: 2; }

/* === Related Sections === */
.related-section, .related-companies-section { padding: 64px 0; }
.bg-light { background-color: var(--bg-light); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; border-bottom: 2px solid #E5EEFF; padding-bottom: 16px; }
.section-text h2 { font-size: 24px; color: var(--primary-text); }
.section-text p { color: var(--text-light); }
.view-all { color: var(--primary-text); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.mb-5 { margin-bottom: 3rem; }
.text-center { text-align: center; }

/* Product Cards (Related) */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.product-card { background: white; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-light); transition: var(--transition); }
.product-card:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.08); }
.product-img { height: 250px; position: relative; background: #eee; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.moq-badge { position: absolute; top: 12px; left: 12px; background: #EAE7EF; color: var(--text-main); padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.product-info { padding: 16px; }
.product-info h3 { font-size: 16px; margin-bottom: 4px; height: 48px; overflow: hidden; }
.company-name { font-size: 14px; color: var(--text-light); margin-bottom: 12px; }
.product-meta { display: flex; justify-content: space-between; align-items: center; border-top: 1px dashed var(--border-color); padding-top: 12px; }
.price { font-size: 16px; font-weight: 700; color: var(--primary-text); }

/* Company Cards (Vertical) */
.companies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.company-card-vertical { background: white; border: 1px solid var(--border-light); border-radius: 12px; padding: 32px 24px; text-align: center; transition: var(--transition); }
.company-card-vertical:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.08); transform: translateY(-5px); }
.company-logo { width: 80px; height: 80px; background: var(--bg-light); border: 2px solid var(--border-color); border-radius: 50%; margin: 0 auto 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.company-logo img { width: 60%; height: 60%; object-fit: contain; }
.company-card-vertical h3 { font-size: 16px; margin-bottom: 8px; }
.badge-certified, .badge-verified, .badge-gold { display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 700; margin-bottom: 16px; }
.badge-certified { background: #E3F2FD; color: #1565C0; }
.badge-verified { background: #E8F5E9; color: #2E7D32; }
.badge-gold { background: #FFF8E1; color: #F57F17; }
.company-card-vertical p { font-size: 14px; color: var(--text-light); margin-bottom: 24px; line-height: 1.6; }

/* === Footer === */
.footer { background:var(--primary); color: rgba(255,255,255,0.8); padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; }
.footer h3 { color: white; font-size: 20px; margin-bottom: 20px; }
.about-col p { line-height: 1.8; }
.footer ul li { margin-bottom: 10px; }
.footer ul a:hover { color: var(--secondary); padding-inline-start: 5px; }
.contact-info li { display: flex; align-items: flex-start; gap: 10px; }
.contact-info i { color: var(--secondary); margin-top: 5px; }
.footer-bottom { margin-top: 40px; border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; text-align: center; font-size: 14px; }

/* === Mobile Responsiveness === */
@media (max-width: 992px) {
    .product-detail-grid { grid-template-columns: 1fr; }
    .product-gallery { order: -1; } /* Image on top in mobile */
    .main-image-container { height: 350px; }
    .footer-grid { grid-template-columns: 1fr; }
    .main-nav { position: fixed; top: 80px; right: -100%; width: 100%; height: calc(100vh - 80px); background: var(--bg-white); flex-direction: column; transition: 0.3s; z-index: 999; padding: 24px; }
    html[dir="ltr"] .main-nav { right: auto; left: -100%; }
    .main-nav.active { right: 0; }
    html[dir="ltr"] .main-nav.active { left: 0; }
    .main-nav ul { flex-direction: column; gap: 24px; }
    .mobile-menu-btn { display: block; }
}

@media (max-width: 768px) {
    .product-title { font-size: 24px; }
    .secondary-actions { flex-direction: column; }
    .products-grid, .companies-grid { grid-template-columns: 1fr; }
    .thumbnail-list { grid-template-columns: repeat(4, 1fr); height: 80px; }
    .thumbnail { height: auto; }
}