/* === Company Details Page - Additional Variables (not overriding main theme) === */
:root {
    --primary-light: #FBF8FF;
    --orange: #FB6D00;
    --text-dark: #000666;
    --text-body: #454652;
    --text-muted: #767683;
    --bg-light: #F8F9FA;
    --bg-input: #F5F2FB;
    --bg-tag: #EAE7EF;
    --border: #C6C5D4;
    --success: #4CAF50;
    --radius-sm: 8px;
    --radius-md: 12px;
    --shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Page-specific button helpers */
.btn-icon-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon-outline:hover {
    background: var(--primary);
    color: white;
}
.btn-block { width: 100%; }

/* Company Hero */
.company-hero { margin-bottom: 0; background: #fff; }
.hero-cover { height: 300px; width: 100%; background: #ddd; overflow: hidden; }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-content1 { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -50px; position: relative; z-index: 1; padding-bottom: 20px; }
.company-brand1 { display: flex; align-items: flex-end; gap: 20px; }
.company-logo1 { width: 100px; height: 100px; background: #fff; border-radius: 50%; padding: 4px; border: 2px solid var(--primary); overflow: hidden; flex-shrink: 0; }
.company-logo1 img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg-tag); }
.company-titles { padding-bottom: 10px; }
.company-titles .badges { display: flex; gap: 8px; margin-bottom: 8px; }
.badge-featured { background: var(--primary); color: #fff; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-verified { background: rgba(76, 175, 80, 0.1); color: var(--success); padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.company-titles h1 { font-size: 28px; color: var(--primary); margin-bottom: 4px; }
.slogan { color: var(--text-muted); font-size: 16px; }
.hero-actions1 { display: flex; gap: 12px; padding-bottom: 20px; flex-shrink: 0; }
.hero-actions1 .btn-icon-outline {
    background: #fff;
    color: var(--orange);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.hero-actions1 .btn-icon-outline i,
.hero-actions1 .btn-icon-outline svg {
    width: 18px;
    height: 18px;
}
.hero-actions1 .btn-icon-outline i {
    font-size: 18px;
    line-height: 1;
}

/* Tabs */
.tabs-nav { background: #fff; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.tabs-container { display: flex; gap: 32px; overflow-x: auto; }
.tab-link { background: none; border: none; font-family: 'Cairo'; font-size: 18px; padding: 16px 0; color: var(--text-body); cursor: pointer; border-bottom: 4px solid transparent; font-weight: 500; white-space: nowrap; position: relative; transition: var(--transition); }
.tab-link:hover { color: var(--primary); }
.tab-link.active { color: var(--orange); border-bottom-color: var(--primary); font-weight: 700; }
.tab-link.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background-color: var(--primary); border-radius: 2px; }

/* Main Content */
.main-content { padding-top: 32px; padding-bottom: 60px; }
.content-wrapper-profile { display: flex; gap: 32px; }
.left-col { flex: 2; min-width: 0; }
.right-col { flex: 1; display: flex; flex-direction: column; gap: 24px; }

/* Cards */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow); }
.dark-card { background: var(--primary); color: #fff; border: none; }
.dark-card h3 { color: var(--orange); border-bottom: 2px solid var(--orange); padding-bottom: 12px; margin-bottom: 16px; font-size: 22px; font-weight: 700; }
.card h3 { margin-bottom: 16px; color: var(--primary); font-size: 20px; }

.card1 { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow); }
.card1.dark-card { background: var(--primary); color: #fff; border: none; }
.card1.dark-card h3 { color: var(--orange); border-bottom: 2px solid var(--orange); padding-bottom: 12px; margin-bottom: 16px; font-size: 22px; font-weight: 700; }
.card1 h3 { margin-bottom: 16px; color: var(--bg-light); font-size: 20px; }

/* Overview */
.overview-card p { margin-bottom: 16px; color: #424242; line-height: 1.8; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.gallery img { width: 100%; height: 150px; object-fit: cover; border-radius: var(--radius-sm); background: #ddd; cursor: pointer; transition: var(--transition); }
.gallery img:hover { transform: scale(1.03); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* Products Tab */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.filter-group-row { display: flex; gap: 12px; align-items: center; }
.custom-select-sm, .search-sm input { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: 'Cairo'; background: var(--bg-input); }
.search-sm { position: relative; }
.search-sm i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
[dir="rtl"] .search-sm i { left: auto; right: 10px; }

/* Product cards inside company details */
#products .products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
#products .product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; transition: var(--transition); }
#products .product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
#products .img-placeholder { height: 140px; background: #ddd; border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
#products .img-placeholder img { width: 100%; height: 100%; object-fit: cover; }
#products .product-card h4 { font-size: 15px; color: var(--text-dark); margin-bottom: 8px; height: 40px; overflow: hidden; }
#products .product-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
#products .product-meta .price { color: var(--primary); font-weight: 700; }
.tag { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.tag.standard { background: #E3F2FD; color: #1565C0; }
.tag.local { background: #FFF3E0; color: #E65100; }

/* Reviews */
.reviews-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.rating-overview { display: flex; gap: 32px; background: #fff; padding: 20px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 24px; }
.big-rating { font-size: 48px; font-weight: 700; color: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 120px; }
.big-rating span { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.progress-bars { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.bar-item { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.bar-item progress { flex: 1; height: 8px; }
.review-card { background: #fff; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; }
.review-head { display: flex; gap: 12px; margin-bottom: 12px; align-items: center; }
.avatar { width: 40px; height: 40px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.review-head .info { flex: 1; }
.review-head .info h4 { font-size: 16px; color: var(--text-dark); }
.review-head .info p { font-size: 12px; color: var(--text-muted); }
.review-head .date { font-size: 12px; color: var(--text-muted); }
.review-text { font-style: italic; margin-bottom: 12px; color: #424242; line-height: 1.7; }
.review-actions { display: flex; gap: 16px; }
.btn-text { background: none; border: none; color: var(--primary); cursor: pointer; font-family: 'Cairo'; font-weight: 600; }

/* Add Review Form */
.add-review-card { background: var(--bg-input); border: 2px solid var(--border); margin-bottom: 24px; }
.add-review-card h4 { color: var(--primary); font-size: 18px; margin-bottom: 16px; }
.review-form { display: flex; flex-direction: column; gap: 16px; }
.rating-input { display: flex; flex-direction: column; gap: 8px; }
.rating-input label { font-weight: 600; color: var(--text-dark); }
.star-rating { display: flex; gap: 8px; cursor: pointer; flex-direction: row-reverse; justify-content: flex-end; }
.star-icon { font-size: 28px; color: #ddd; cursor: pointer; transition: all 0.2s ease; }
.star-icon:hover { color: var(--orange); transform: scale(1.1); }
.star-icon.active { color: var(--orange); }
.rating-text { font-size: 14px; color: var(--text-muted); min-height: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.review-form textarea { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: 'Cairo'; background: #fff; resize: vertical; }
.review-form textarea:focus { outline: none; border-color: var(--orange); }

/* Certificates */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cert-card { background: var(--bg-light); padding: 16px; border-radius: var(--radius-sm); border-left: 4px solid var(--primary); }
[dir="ltr"] .cert-card { border-left: none; border-right: 4px solid var(--primary); }
.cert-card h4 { color: var(--primary); margin-bottom: 4px; }
.cert-card p { font-size: 14px; margin-bottom: 4px; }
.cert-card span { font-size: 12px; color: var(--text-muted); }

/* Contact Tab */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 16px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: 'Cairo'; background: var(--bg-input); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--primary); }

/* Right Sidebar Lists */
.facts-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.facts-list li { display: flex; justify-content: space-between; font-size: 16px; }
.facts-list li strong { color: #8690EE; }
.facts-list li span { color: rgba(255,255,255,0.7); }
.contact-list { list-style: none; margin-bottom: 16px; }
.contact-list li { display: flex; gap: 12px; margin-bottom: 12px; font-size: 14px; align-items: flex-start; }
.contact-list li i { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.similar-item { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); text-decoration: none; }
.similar-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.similar-item img { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: #ddd; }
.similar-info h4 { font-size: 14px; color: var(--text-dark); }
.similar-info p { font-size: 12px; color: var(--text-muted); }

/* Tab Content Hidden */
.tab-content { display: none; opacity: 0; transform: translateY(15px); transition: opacity 0.4s ease, transform 0.4s ease; }
.tab-content.active { display: block; opacity: 1; transform: translateY(0); animation: fadeIn 0.5s ease forwards; }

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

/* Responsive Map Container */
.map-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
}
.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    max-width: 100%;
}

/* Prevent horizontal scroll from any embedded content */
.card iframe,
.left-col iframe,
.tab-content iframe {
    max-width: 100% !important;
}

/* Ensure left column doesn't overflow */
.left-col {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Prevent any element from causing horizontal scroll */
.content-wrapper-profile {
    overflow-x: hidden;
}

/* Responsive */
@media (max-width: 1024px) {
    .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    .header-container { height: 70px; }
    .main-nav {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #FBF8FF;
        flex-direction: column;
        transition: var(--transition);
        z-index: 999;
        padding: 24px;
    }
    .main-nav.active { right: 0; }
    .main-nav ul { flex-direction: column; gap: 24px; }
    .mobile-menu-btn { display: block; }
    .hero-content1 { flex-direction: column; align-items: flex-start; }
    .content-wrapper-profile { flex-direction: column; overflow-x: hidden; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .rating-overview { flex-direction: column; }
    .form-row { flex-direction: column; }
    .company-titles h1 { font-size: 22px; }
    .company-logo1 { width: 70px; height: 70px; }
    .hero-cover { height: 180px; }
    .company-brand1 { flex-wrap: wrap; }
    .map-container { padding-bottom: 75%; }
}
