/* =============================================
   PRODUCTS PAGE CSS - JK Drive Technology
   Pixel-matched to jkdrive.lk/our-all-products/
   ============================================= */

/* ------------------------------------------------------------------
   1) HERO / INTRO  – light-gray panel with title + welcome paragraph
   ------------------------------------------------------------------ */
.products-intro {
    background: #ededed;
    padding: 50px 0 50px;
    text-align: center;
}

.products-intro-title {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0 0 22px;
}

.products-intro-text {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.9;
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
}

/* ------------------------------------------------------------------
   2) PRODUCTS GRID  – clean 4-column grid, white background
   ------------------------------------------------------------------ */
.products-grid-section {
    background: var(--white);
    padding: 60px 0 70px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 30px;
}

/* ── Product card ── */
.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.35s ease;
}

.product-card:hover { transform: translateY(-3px); }

.product-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 12px;
}

.product-card:hover .product-image-wrap img { transform: scale(1.04); }

/* ── Image link covering the whole image area ── */
.product-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

/* ── Floating Quick View icon (top-right corner of image) ── */
.product-quickview-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    color: var(--primary);
    border: 1px solid #e0e0e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.product-card:hover .product-quickview-icon {
    opacity: 1;
    transform: translateY(0);
}

.product-quickview-icon:hover,
.product-quickview-icon:focus-visible {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    outline: none;
}

/* ── Product name ── */
.product-name-link { text-decoration: none; }

.product-name {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    color: #2b2b2b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1.4;
    transition: color 0.25s ease;
}

.product-name-link:hover .product-name { color: var(--accent); }

/* ------------------------------------------------------------------
   3) QUICK-VIEW MODAL
   ------------------------------------------------------------------ */
.qv-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qv-modal.open { display: flex; }

.qv-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 45, 0.78);
    cursor: pointer;
}

.qv-dialog {
    position: relative;
    width: 100%;
    max-width: 880px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: qvSlideIn 0.3s ease;
}

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

.qv-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #d0d0d0;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.25s ease;
}

.qv-close:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }

.qv-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}

.qv-image {
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 400px;
}

.qv-image img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.qv-info {
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
}

.qv-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
    line-height: 1.25;
}

.qv-sep {
    border: none;
    border-top: 1px solid #ddd;
    margin: 0 0 20px;
}

.qv-cat {
    font-size: 13px;
    color: #666;
    margin: 0 0 24px;
}

.qv-cat strong { color: #333; font-weight: 600; }

/* ── Share buttons (modal) ── */
.qv-share { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; }

.qv-share-label {
    font-size: 13px;
    color: #555;
    margin-right: 4px;
    font-weight: 600;
}

.qv-share-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.qv-share-btn:hover {
    background: var(--accent);
    color: var(--white);
}

.qv-readmore {
    align-self: flex-start;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.25s ease;
}

.qv-readmore:hover { color: var(--accent-hover); }

/* ------------------------------------------------------------------
   4) SINGLE PRODUCT PAGE
   ------------------------------------------------------------------ */

/* Breadcrumb */
.single-breadcrumb {
    background: var(--white);
    padding: 22px 0 4px;
    border-bottom: 1px solid #f0f0f0;
}

.sb-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.sb-nav a { color: #666; text-decoration: none; transition: color 0.2s; }
.sb-nav a:hover { color: var(--accent); }
.sb-nav .sb-sep { color: #aaa; font-size: 9px; }
.sb-current { color: #2b2b2b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* Main product layout */
.single-product-section {
    background: var(--white);
    padding: 50px 0 70px;
}

.single-product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fafafa;
    border: 1px solid #efefef;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-product-img img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.sp-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid #ddd;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.25s ease;
}

.sp-zoom:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }

.single-product-info { padding-left: 10px; }

/* Pager (prev / grid / next) */
.sp-pager { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 16px; }

.sp-pager-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.sp-pager-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }

.sp-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 18px;
    line-height: 1.2;
}

.sp-cat {
    font-size: 14px;
    color: #555;
    padding-bottom: 16px;
    border-bottom: 1px solid #ececec;
    margin-bottom: 18px;
}

.sp-cat strong { color: #333; font-weight: 600; margin-right: 6px; }
.sp-cat a { color: #666; text-decoration: none; }
.sp-cat a:hover { color: var(--accent); }

/* Share buttons (single product) */
.sp-share-row { display: flex; align-items: center; gap: 10px; }
.sp-share-label { font-weight: 600; color: #444; font-size: 14px; margin-right: 6px; }
.sp-share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s ease;
    font-size: 13px;
}
.sp-share-btn:hover { background: var(--accent); color: var(--white); }

/* ------------------------------------------------------------------
   5) IMAGE LIGHTBOX
   ------------------------------------------------------------------ */
.sp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.sp-lightbox.open { display: flex; }

.sp-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.sp-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.sp-lightbox-close:hover { background: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------------------------
   6) REVIEWS SECTION
   ------------------------------------------------------------------ */
.single-reviews-section {
    background: var(--white);
    padding: 30px 0 60px;
    border-top: 1px solid #f0f0f0;
}

.reviews-heading {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #2b2b2b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 18px;
}

.reviews-empty {
    font-size: 14px;
    color: #777;
    margin: 0;
}

.reviews-note {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px;
}

.reviews-note .req { color: #e74c3c; font-weight: 700; }

/* Review form */
.review-form { display: flex; flex-direction: column; gap: 14px; }

.rf-row { display: flex; flex-direction: column; gap: 6px; }
.rf-row label { font-size: 13px; color: #444; font-weight: 500; }
.rf-row .req { color: #e74c3c; font-weight: 700; }

.rf-row input,
.rf-row textarea {
    background: var(--white);
    border: 1px solid #d0d0d0;
    border-radius: 0;
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--primary);
    transition: border-color 0.2s ease;
    outline: none;
}

.rf-row input:focus,
.rf-row textarea:focus { border-color: var(--accent); }

.rf-row textarea { resize: vertical; min-height: 110px; }

.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Star rating */
.rf-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 2px;
    margin-top: 4px;
}
.rf-stars input { display: none; }
.rf-stars label {
    cursor: pointer;
    color: #ddd;
    font-size: 16px;
    transition: color 0.15s ease;
}
.rf-stars input:checked ~ label,
.rf-stars label:hover,
.rf-stars label:hover ~ label { color: #f5a623; }

.rf-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.rf-submit {
    align-self: flex-start;
    background: #00acc1;
    color: var(--white);
    border: none;
    padding: 11px 28px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    margin-top: 6px;
    transition: background 0.25s ease;
}

.rf-submit:hover { background: #008c9c; }

/* ------------------------------------------------------------------
   7) RELATED PRODUCTS
   ------------------------------------------------------------------ */
.related-products-section {
    background: var(--white);
    padding: 30px 0 70px;
    border-top: 1px solid #f0f0f0;
}

.rp-heading {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #2b2b2b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 24px;
}

.rp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

/* ------------------------------------------------------------------
   8) RESPONSIVE
   ------------------------------------------------------------------ */
@media (max-width: 1199px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .rp-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 991px) {
    .products-intro-title { font-size: 26px; }

    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
    .rp-grid { grid-template-columns: repeat(2, 1fr); gap: 25px; }

    .qv-body { grid-template-columns: 1fr; }
    .qv-image { padding: 30px 20px; min-height: 280px; }
    .qv-info { padding: 30px 24px; }
    .qv-title { font-size: 22px; }

    .single-product-info { padding-left: 0; }
    .sp-pager { justify-content: flex-start; }
    .sp-title { font-size: 26px; }

    .rf-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
    .products-intro { padding: 40px 0; }
    .products-intro-title { font-size: 22px; letter-spacing: 1px; }
    .products-intro-text { font-size: 13px; }

    .products-grid-section { padding: 40px 0 50px; }
    .products-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }

    .product-name { font-size: 12px; }
    .product-action-btn { padding: 6px 12px; font-size: 11px; min-width: 110px; }

    .rp-grid { grid-template-columns: 1fr 1fr; gap: 20px 14px; }

    .single-product-section { padding: 30px 0 40px; }
    .sp-title { font-size: 22px; }

    .reviews-heading { font-size: 16px; }
}
