/* ============================================================
   CD PRODUCT CARD — Custom Layout
   এই ফাইলটি style.css এর শেষে যোগ করুন অথবা
   আলাদা ফাইল হিসেবে link করুন।
   ============================================================ */

/* ── Grid: Home ── */
.main_product_inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    overflow: hidden;
}

/* ── Grid: Category Page ── */
.category-product {
    grid-template-columns: repeat(4, 1fr);
}

/* iPad/tablet range (768px-1024px, includes iPad Pro at exactly 1024px) with sidebar present — 4 columns was too narrow, use 3 */
@media (min-width: 768px) and (max-width: 1024px) {
    .category-product {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Grid: Shop Page (কাটেগরি পেজের চেয়ে আলাদা কলাম সংখ্যা — .category-product এর পরে লেখা সেইজন্য এটাই win করে) ── */
.shop-product-grid {
    grid-template-columns: repeat(5, 1fr);
}

/* ── Card Wrapper ── */
.cd-product-card {
    background: #ffffff;
    border: 1px solid var(--text-color);
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cd-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
}

/* ── Market Status Badge (Upcoming/Discontinued) ── */
.cd-status-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 3px 9px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 3px;
    color: #ffffff;
}

.cd-status-upcoming {
    background: #1e88e5;
}

.cd-status-discontinued {
    background: #6b6b6b;
}

/* ── Discount Badge ── */
.cd-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    line-height: 1.1;
}

.cd-badge-percent {
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.cd-badge-label {
    color: #fff;
    font-size: 8px;
    font-weight: 500;
}

/* ── Image Area ── */
.cd-card-img {
    height: 190px;
    overflow: hidden;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ── Spec Score Badge (image এর উপরে সার্কেল ব্যাজ, ঠিক discount badge-এর মতো — market status badge
   top-left এ থাকায় এটা top-right এ) ── */
.cd-spec-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: var(--primary-color, #16a34a);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.cd-spec-badge-percent {
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
}

.cd-spec-badge-label {
    color: #fff;
    font-size: 6.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.cd-card-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.cd-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.cd-product-card:hover .cd-card-img img {
    transform: scale(1.06);
    transition: transform 0.4s cubic-bezier(0, 0, 0.44, 1.18);
}

/* ── Card Body ── */
.cd-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Title (সর্বোচ্চ ২ লাইন) ── */
.cd-card-title {
    font-size: 13.5px;
    font-weight: 500;
    color: #111111;
    line-height: 1.4;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 7px;
}

.cd-card-title a {
    color: #111111;
    text-decoration: none;
}

.cd-card-title a:hover {
    text-decoration: underline;
}

/* ── Stars ── */
.cd-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 7px;
}

.cd-stars i {
    color: #e98c1d;
    font-size: 12px;
}

.cd-stars .far.fa-star {
    color: #dddddd;
}

/* ── Price ── */
.cd-price {
    margin-bottom: 10px;
}

.cd-price-old {
    display: block;
    color: #999999;
    font-size: 12px;
    text-decoration: line-through;
    font-weight: 400;
    line-height: 1.3;
}

.cd-price-new {
    display: block;
    color: #111111;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2px;
}

/* Multi-variant Price Cards feature — a product without any set price yet
   (product-level or every variant) shows this instead of a price. */
.cd-price-coming-soon {
    display: block;
    color: #999999;
    font-size: 14px;
    font-style: italic;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2px;
}

/* ── Buttons ── */
.cd-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cd-form {
    margin: 0;
}

.cd-btn {
    display: block;
    width: 100%;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s ease;
}

.cd-btn-cart {
    background: #111111;
    color: #ffffff;
}

.cd-btn-cart:hover {
    background: #333333;
    color: #ffffff;
}

/* এটা একটা price/spec comparison সাইট, কেনাকাটার সাইট না — তাই "View Details"-কে বড় রঙিন
   CTA বাটনের বদলে সাধারণ বোল্ড টেক্সট লিংক রাখা হলো (GSMArena/MobileDokan-এর মতো), যাতে
   পুরো কার্ডের ফোকাস প্রাইস/স্পেকের উপর থাকে, বাটনের উপর না। */
.cd-btn-buy {
    background: transparent;
    color: var(--text-color);
    font-weight: 700;
    border-top: 1px solid #eee;
    padding-top: 9px;
}

.cd-btn-buy:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .main_product_inner,
    .category-product,
    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .cd-card-img {
        height: 150px;
    }

    .cd-price-new {
        font-size: 15px;
    }

    .cd-card-title {
        font-size: 12.5px;
        height: 35px;
    }

    .cd-btn {
        font-size: 12px;
        padding: 7px 0;
    }
}

/* ── Brand Detail Page header (আগে ভুলবশত শুধু হোমপেজের inline <style>-এ ছিল,
   তাই brand পেজে সরাসরি হার্ড-রিলোড দিলে এই rule লোডই হতো না — h1 ব্রাউজারের
   ডিফলস্ট (অনেক বড়) সাইজে পড়ে যেতো। এখানে গ্লোবাল bundle-এ আনা হলো যাতে সব পেজ-লোডে
   (হোম থেকে ক্লিক করে আসা হোক বা সরাসরি রিলোড) কনসিস্টেন্ট থাকে। ── */
.brand-page-header {
    gap: 12px;
    margin-bottom: 15px;
}
.brand-page-header img {
    object-fit: contain;
}
.brand-page-title {
    font-size: 20px;
    margin: 0;
}

/* ============================================================
   COMPARE FEATURE — header badge, toggle buttons, compare page
   (আগে এই CSS আলাদা compare.css ফাইলে ছিল, master.blade.php-এ একটা এক্সট্রা <link> ডেকেইনেইটিভ
     ~5KB এর একটা অ্যাডিশনাল HTTP request হতো — product-card.css এর সাথে ঘনিষ্ঠভাবে সংযুক্ত বিষয়
     (প্রোডাক্ট কার্ড/কমপেয়ার পেজ) বলে এখানেই জুড়ে দেওয়া হলো, আলাদা <link> সরানো হলো। --*/

/* ── Header "Compare" link + count badge ── */
.compare_header_btn a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.compare-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    background: var(--primary-color, #091dd6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.15s ease;
}

/* উড়ন্ত প্রোডাক্ট ছবি হেডারের Compare আইকনে পৌঁছানোর সাথে সাথে ব্যাজের ছোট্ট পপ/বাউন্স —
   master.blade.php-এর flyToCompareIcon() এই ক্লাসটা সংক্ষিপ্ত সময়ের জন্য যোগ করে দেয়। */
.compare-badge-pop {
    animation: compareBadgePop 0.38s ease;
}

@keyframes compareBadgePop {
    0% { transform: scale(1); }
    35% { transform: scale(1.55); }
    65% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ── Compare toggle button (product card) ── */
.cd-btn-compare {
    background: #ffffff;
    color: #111111;
    border: 1px solid #cccccc !important;
}

.cd-btn-compare:hover {
    background: #f2f2f2;
    color: #111111;
}

.cd-btn-compare.active {
    background: var(--primary-color, #091dd6);
    color: #fff;
    border-color: var(--primary-color, #091dd6) !important;
}

/* ── Compare toggle button (product details buy-box) ── */
.compare-add-btn {
    width: 100%;
    padding: 9px 0;
    font-size: 13px;
    font-weight: 600;
    background: #ffffff;
    color: #111111;
    border: 1px solid #cccccc;
    border-radius: 3px;
    cursor: pointer;
}

.compare-add-btn:hover {
    background: #f2f2f2;
}

.compare-add-btn.active {
    background: var(--primary-color, #091dd6);
    color: #fff;
    border-color: var(--primary-color, #091dd6);
}

/* ============================================================
   Compare Page
   ============================================================ */
.compare-page-wrap {
    padding: 30px 0 60px;
    background: #f4f6f9;
}

.compare-empty {
    text-align: center;
    padding: 70px 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #ececf2;
}

.compare-empty i {
    font-size: 44px;
    color: #c9ccd6;
    margin-bottom: 16px;
}

.compare-empty p {
    color: #767a85;
    margin-bottom: 20px;
}

/* Card frame around the whole table so it reads as one distinct block
   on the page (rather than a bare table sitting on the background). */
.compare-table-scroll {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e8e9ee;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(20, 20, 43, 0.05);
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 680px;
}

.compare-table th,
.compare-table td {
    padding: 14px 18px;
    vertical-align: middle;
    text-align: left;
    border-bottom: 1px solid #eef0f4;
}

/* Vertical dividers between every product column so each product visually
   reads as its own "lane" instead of blending into the next one. */
.compare-table th:not(:first-child),
.compare-table td:not(:first-child) {
    border-left: 1px solid #eef0f4;
}

/* ── Sticky row-label column (left rail) ── */
.compare-table .compare-row-label {
    width: 190px;
    min-width: 170px;
    background: #f8f9fc;
    font-weight: 600;
    font-size: 13.5px;
    color: #4a4d57;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 2px solid #e8e9ee;
}

.compare-table .compare-product-col {
    width: 230px;
    min-width: 210px;
}

/* Subtle zebra + hover on the spec rows so a long list of rows stays
   scannable row-by-row. */
.compare-table tbody tr:not(.compare-group-heading):hover td {
    background: #f9fafc;
}

.compare-table tbody tr:not(.compare-group-heading):hover .compare-row-label {
    background: #f1f3f8;
}

/* ── Section / group divider ── */
.compare-table .compare-group-heading td {
    background: linear-gradient(0deg, #eef1fb, #eef1fb);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.6px;
    color: var(--primary-color, #091dd6);
    border-top: 1px solid #dfe3f5;
    border-bottom: 1px solid #dfe3f5;
    padding-top: 11px;
    padding-bottom: 11px;
}

.compare-table .compare-group-heading td::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 2px;
    background: var(--primary-color, #091dd6);
    vertical-align: middle;
}

/* ── Product header row (thead) — sticks to top while scrolling the
   table vertically, and reads as a row of distinct product "cards". ── */
.compare-table thead th {
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(20, 20, 43, 0.06);
}

.compare-table thead th.compare-row-label {
    z-index: 4;
}

.compare-product-head {
    text-align: center;
    padding: 6px 4px 10px;
}

.compare-product-remove {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 auto 10px;
    background: #f4f5f8;
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    color: #8b8f9a;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.compare-product-remove:hover {
    background: #fde9e8;
    color: #d9534f;
}

.compare-product-head a {
    display: block;
}

.compare-product-head img {
    width: 100%;
    max-width: 130px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    transition: box-shadow 0.15s, transform 0.15s;
}

.compare-product-head a:hover img {
    box-shadow: 0 6px 16px rgba(20, 20, 43, 0.10);
    transform: translateY(-2px);
}

.compare-product-head .compare-product-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1c1d24;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
    margin-bottom: 6px;
    text-decoration: none;
}

.compare-product-head .compare-product-price {
    display: inline-block;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color, #091dd6);
    background: #eef1fb;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.compare-product-head .compare-product-view {
    display: inline-block;
    width: 100%;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 0;
    background: var(--primary-color, #091dd6);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: opacity 0.15s;
}

.compare-product-head .compare-product-view:hover {
    opacity: 0.88;
}

/* ── Compare page responsive ── */
@media (max-width: 576px) {
    .compare-table .compare-row-label {
        width: 120px;
        min-width: 110px;
        font-size: 12.5px;
        padding: 12px 10px;
    }

    .compare-table .compare-product-col {
        width: 170px;
        min-width: 160px;
    }

    .compare-table th,
    .compare-table td {
        padding: 10px 10px;
    }
}

/* Ad disclosure badge — small overlay label on affiliate/external Banner images (Sponsored/Ad/Advertisement),
   admin-selectable per banner (Banner & Ads > label field). Any wrapper around a banner <img> just needs
   position:relative + class "banner-ad-label-wrap" and a ".banner-ad-label" span inside. */
.banner-ad-label-wrap {
    position: relative;
    display: block;
}
.banner-ad-label {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: 3px;
    line-height: 1.4;
}
