/* =========================================
   ۱. گالری تصاویر محصول
========================================= */
.cpc-gallery-wrapper { position: relative; max-width: 850px; margin: 0 auto; }
.cpc-main-img-container { padding: 10px; border: 1px solid rgb(8,111,183); box-shadow: 0px 0px 2px grey; background: #fff; cursor: pointer; line-height: 0; transition: 0.3s; border-radius: 8px; }
.cpc-main-img-container:hover { border-color: rgb(249,157,27); }
.cpc-main-img-container img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 850/530; border-radius: 4px; }
.cpc-lightbox-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 999999; justify-content: center; align-items: center; direction: ltr; }
.cpc-lightbox-content { display: flex; width: 90%; max-width: 1200px; height: 80vh; background: #111; border-radius: 8px; overflow: hidden; position: relative; }
.cpc-lb-sidebar { width: 20%; background: #222; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid #333; scrollbar-width: thin; scrollbar-color: rgb(8,111,183) #222; }
.cpc-lb-sidebar img { width: 100%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; aspect-ratio: 850/530; object-fit: cover; border-radius: 4px; }
.cpc-lb-sidebar img.active, .cpc-lb-sidebar img:hover { border-color: rgb(249,157,27); }
.cpc-lb-main { width: 80%; position: relative; display: flex; justify-content: center; align-items: center; padding: 20px; }
.cpc-lb-main img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.cpc-lb-close { position: absolute; top: 15px; right: 15px; color: #fff; font-size: 35px; cursor: pointer; z-index: 10; transition: color 0.3s; line-height: 1; }
.cpc-lb-close:hover { color: rgb(249,157,27); }
.cpc-lb-download { position: absolute; bottom: 20px; right: 20px; background: rgb(249,157,27); color: #fff; padding: 10px 20px; text-decoration: none; border-radius: 4px; font-weight: bold; transition: background 0.3s; }
.cpc-lb-download:hover { background: rgb(8,111,183); }

/* =========================================
   ۲. تب‌ها و جدول
========================================= */
.cpc-tabs-container { margin: 30px auto; width: 100%; font-family: inherit; }
.cpc-tabs-nav { display: flex; list-style: none; padding: 0; margin: 0; border-bottom: 2px solid rgb(8,111,183); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
.cpc-tabs-nav::-webkit-scrollbar { display: none; }
.cpc-tab-item { flex: 0 0 auto; text-align: center; }
.cpc-tab-link { display: block; padding: 14px 24px; background: #f7f7f7; color: #555; text-decoration: none; font-weight: bold; border: 1px solid #ddd; border-bottom: none; cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0; margin-right: 2px; }
.cpc-tab-item.active .cpc-tab-link { background: rgb(8,111,183); color: #fff; border-color: rgb(8,111,183); }
.cpc-tabs-content-wrapper { border: 1px solid #ddd; border-top: none; background: #fff; padding: 25px; border-radius: 0 0 8px 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.cpc-tab-panel { display: none; max-height: 400px; overflow-y: auto; padding-right: 10px; line-height: 1.8; color: #444; }
.cpc-tab-panel.active { display: block; animation: cpcFadeIn 0.4s ease-in-out; }
@keyframes cpcFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.cpc-btn-download { display: inline-block; background: rgb(249,157,27); color: #fff; padding: 12px 25px; text-decoration: none; border-radius: 4px; font-weight: bold; transition: 0.3s; }
.cpc-btn-download:hover { background: rgb(8,111,183); color: #fff; }

.cpc-table-responsive { margin: 20px 0; border-radius: 8px; overflow: hidden; }
.cpc-front-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: center; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.cpc-front-table th, .cpc-front-table td { border: 1px solid #eee; padding: 15px; }
.cpc-front-table th { background-color: rgb(8,111,183); color: white; font-weight: bold; border-color: rgb(8,111,183); }
.cpc-front-table tr:nth-child(even) { background-color: #fafafa; }

/* =========================================
   ۳. شبکه فروشگاه
========================================= */
.cpc-shop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; max-width: 1100px; margin: 40px auto; padding: 0 15px; min-height: calc(100vh - 350px); align-content: start; }
.cpc-shop-card { text-decoration: none; display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.05); opacity: 0; transform: translateY(30px); transition: box-shadow 0.3s ease; }
.cpc-shop-card.cpc-in-view { opacity: 1; transform: translateY(0); transition: opacity 0.6s ease, transform 0.6s ease; }
.cpc-shop-card:hover { box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.cpc-shop-image-wrapper { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #f9f9f9; display: flex; align-items: center; justify-content: center; }
.cpc-shop-image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.cpc-shop-card:hover .cpc-shop-image-wrapper img { transform: scale(1.1); }
.cpc-shop-content { padding: 12px; text-align: center; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; }
.cpc-shop-title { font-size: 14px; color: #333; margin: 0 0 12px 0; line-height: 1.4; font-weight: bold; }
.cpc-shop-btn { display: inline-block; background: rgb(8,111,183); color: #fff; padding: 7px 12px; border-radius: 4px; font-size: 13px; font-weight: bold; margin: 0 auto; }
.cpc-pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0; flex-wrap: wrap; direction: ltr; }
.cpc-pagination a, .cpc-pagination span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #ddd; background: #fff; color: #333; text-decoration: none; border-radius: 4px; font-weight: bold; transition: 0.3s; }
.cpc-pagination a:hover, .cpc-pagination .current { background: rgb(249,157,27); color: #fff; border-color: rgb(249,157,27); }

/* =========================================
   ۴. صفحه نخست اختصاصی (اسکرول بومی + شرکا)
========================================= */
html { scroll-behavior: smooth; overflow-x: hidden; }

.cpc-home-wrapper {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    scroll-snap-type: y proximity; 
    margin-top: -40px; 
}
.cpc-home-section { width: 100%; scroll-snap-align: start; position: relative; }

/* سکشن اول */
.cpc-section-hero { height: calc(100vh + 40px); overflow: hidden; display: flex; justify-content: center; align-items: center; }

/* اسلایدر با زوم و تفکیک دسکتاپ/موبایل */
.cpc-hero-bgs { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; background: #111; overflow: hidden; }
.cpc-hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transform: scale(1); transition: opacity 1.5s ease-in-out, transform 6s linear; }
.cpc-hero-bg.active { opacity: 0.5; transform: scale(1.15); }
.cpc-bg-mobile { display: none; }

/* محتوای مرکز */
.cpc-hero-center { position: relative; z-index: 2; text-align: center; color: #fff; width: 100%; padding: 0 15px; }

/* لوگو استاندارد */
.cpc-hero-logo { width: 250px !important; max-width: 100% !important; height: auto !important; margin: 0 auto 20px auto !important; display: block !important; animation: slideDown 1s ease forwards; }
@keyframes slideDown { from{ opacity:0; transform:translateY(-30px); } to{ opacity:1; transform:translateY(0); } }

/* متن فارسی زیر لوگو */
.cpc-hero-text { font-size: 22px; font-weight: bold; margin-top: 15px; direction: rtl; display: flex; justify-content: center; flex-wrap: wrap; line-height: 1.8; }
.cpc-hero-text span { opacity: 0; display: inline-block; transform: translateY(10px); transition: all 0.5s ease; }
.cpc-hero-text span.show { opacity: 1; transform: translateY(0); }
.cpc-hero-text span.space { width: 8px; }

/* نشانگر اسکرول */
.cpc-scroll-indicator { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; color: #fff; opacity: 0.8; }
.cpc-scroll-word { font-size: 10px; letter-spacing: 2px; margin: 5px 0; }
.cpc-mouse { width: 24px; height: 38px; border: 2px solid #fff; border-radius: 12px; position: relative; display: flex; justify-content: center; }
.cpc-wheel { width: 4px; height: 8px; background: #fff; border-radius: 2px; margin-top: 6px; animation: mouseWheel 1.5s infinite; }
@keyframes mouseWheel { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(15px); opacity: 0; } }

/* سکشن دوم */
.cpc-section-content { background: #fff; padding: 60px 0; }
.cpc-home-container-inner { max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.cpc-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 60px; }
.cpc-cat-item { position: relative; border-radius: 8px; overflow: hidden; display: block; aspect-ratio: 3/2; background: #000; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.cpc-cat-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: transform 0.5s ease, opacity 0.5s ease; }
.cpc-cat-item:hover img { transform: scale(1.1); opacity: 0.5; }
.cpc-cat-caption { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 20px; font-weight: bold; text-shadow: 1px 1px 5px rgba(0,0,0,0.8); transition: bottom 0.3s ease; }
.cpc-cat-item:hover .cpc-cat-caption { bottom: 30px; color: rgb(249,157,27); }

/* شرکا */
.cpc-partners-section { padding-top: 40px; border-top: 1px solid #eee; }
.cpc-partner-title { font-size: 24px; color: rgb(8,111,183); margin-bottom: 10px; font-weight: bold; }
.cpc-partner-desc { font-size: 15px; color: #666; margin-bottom: 40px; max-width: 800px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.cpc-marquee-wrapper { width: 100%; overflow: hidden; background: #fafafa; padding: 30px 0; border-radius: 8px; }
.cpc-marquee-track { display: flex; align-items: center; width: max-content; animation: cpcMarquee 12s linear infinite; }
.cpc-marquee-wrapper:hover .cpc-marquee-track { animation-play-state: paused; }
.cpc-marquee-item { width: 150px; margin: 0 30px; flex-shrink: 0; filter: grayscale(100%); opacity: 0.6; transition: 0.3s ease; }
.cpc-marquee-item img { width: 100%; height: auto; object-fit: contain; }
.cpc-marquee-item:hover { filter: grayscale(0%); opacity: 1; transform: scale(1.1); }
@keyframes cpcMarquee { 0% { transform: translateX(0); } 100% { transform: translateX(50%); } }

/* =========================================
   ۵. واکنش‌گرایی موبایل
========================================= */
@media screen and (max-width: 1024px) {
    .cpc-shop-grid { grid-template-columns: repeat(3, 1fr); max-width: 900px; }
    .cpc-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

@media screen and (max-width: 768px) {
    .cpc-bg-desktop { display: none !important; }
    .cpc-bg-mobile { display: block; }
    
    .cpc-home-wrapper { margin-top: -20px; } 
    .cpc-section-hero { height: calc(100vh + 20px); }
    .cpc-hero-text { font-size: 16px; margin-top: 10px; line-height: 2; padding: 0 10px; }
    .cpc-hero-logo { width: 160px !important; margin-bottom: 10px !important; }
    .cpc-scroll-indicator { bottom: 15px; transform: scale(0.8) translateX(-50%); transform-origin: left; }

    .cpc-section-content { padding: 40px 0; }
    .cpc-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 40px; }
    .cpc-cat-item { aspect-ratio: 1 / 1; border-radius: 6px; }
    .cpc-cat-caption { font-size: 14px; bottom: 10px; text-align: center; width: 100%; }
    .cpc-cat-item:hover .cpc-cat-caption { bottom: 15px; }

    .cpc-partner-title { font-size: 18px; }
    .cpc-partner-desc { font-size: 13px; margin-bottom: 25px; }
    .cpc-marquee-item { width: 80px; margin: 0 15px; }
    .cpc-marquee-wrapper { padding: 20px 0; }

    .cpc-shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 15px auto; }
    .cpc-shop-title { font-size: 12px; margin-bottom: 8px; }
    .cpc-shop-btn { padding: 5px 10px; font-size: 11px; }

    .cpc-lightbox-content { flex-direction: column-reverse; height: 90vh; width: 95%; } 
    .cpc-lb-sidebar { width: 100%; height: 20%; flex-direction: row; border-right: none; border-top: 1px solid #333; overflow-x: auto; align-items: center; } 
    .cpc-lb-sidebar img { width: auto; height: 90%; } 
    .cpc-lb-main { width: 100%; height: 80%; padding: 10px; } 

    .cpc-tabs-container { margin: 0 auto 5px auto !important; } 
    .cpc-table-responsive { margin: 0 auto 15px auto !important; }
    .cpc-front-table { border: none; box-shadow: none; background: transparent; }
    .cpc-front-table thead { display: none; }
    .cpc-front-table tr { display: block; margin-bottom: 15px; background: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
    .cpc-front-table td { display: flex; justify-content: space-between; align-items: center; text-align: left; border: none; border-bottom: 1px solid #eee; padding: 10px 15px; font-size: 13px; }
    .cpc-front-table td:last-child { border-bottom: none; }
    .cpc-front-table td::before { content: attr(data-label); font-weight: bold; color: rgb(8,111,183); margin-left: 15px; text-align: right; flex-basis: 40%; flex-shrink: 0; }
}