/* ===================================================================
   PRODUCT PAGE — GLOBAL CONTAINER
=================================================================== */

.sf-product-page {
    width: 100%;
    padding: 12px 0 30px;
    box-sizing: border-box;
}

/* ===================================================================
   ROW 1 — GALLERY + PRODUCT INFO
=================================================================== */

.sf-product-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
    padding: 6px;
}

@media (max-width: 992px) {
    .sf-product-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===================================================================
   LEFT COLUMN — IMAGE GALLERY
=================================================================== */

.sf-product-gallery {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Main image */
.sf-product-main-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f3f3;
}

.sf-product-main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Thumbnails */
.sf-product-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.sf-product-thumbs::-webkit-scrollbar {
    height: 6px;
}

.sf-thumb {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: 0.18s ease;
}

.sf-thumb:hover {
    border-color: var(--color-primary);
    transform: scale(1.05);
}

.sf-thumb.active {
    border-color: var(--color-primary);
}

/* ===================================================================
   RIGHT COLUMN — PRODUCT INFO
=================================================================== */

.sf-product-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-product-title {
    font-size: 30px;
    font-weight: 700;
    color: #111;
    line-height: 1.25;
}

@media (max-width: 600px) {
    .sf-product-title {
        font-size: 24px;
    }
}

/* Short intelligent description */
.sf-product-shortdesc {
    font-size: 15px;
    line-height: 1.55;
    color: #444;
    margin-top: -4px;
}

/* Price block */
.sf-product-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
}

.sf-product-unit {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin-left: 4px;
}

/* ===================================================================
   QTY + ADD TO CART ROW
=================================================================== */

.sf-product-action {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 10px 0 0;
}

.sf-product-action .sf-pqty {
    flex: 0 0 140px;
}

.sf-product-action .sf-add-btn {
    flex: 1;
    padding: 14px 22px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.sf-product-action .sf-add-btn:hover {
    background: var(--color-primary-dark);
}

@media (max-width: 768px) {
    .sf-product-action {
        flex-direction: column;
        align-items: stretch;
    }
    .sf-product-action .sf-add-btn {
        width: 100%;
    }
}

/* ===================================================================
   PRODUCT META — Category, Availability, Sold
=================================================================== */

.sf-product-meta {
    margin-top: 14px;
    font-size: 15px;
    color: #555;
    line-height: 1.5;
}

.sf-product-meta div + div {
    margin-top: 4px;
}

/* ===================================================================
   TABS — NAVIGATION
=================================================================== */

.sf-product-tabs {
    margin-top: 0px;
    width: 100%;
    padding: 10px;
}

.sf-tab-nav {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 20px;
}

.sf-tab-nav button {
    position: relative;
    padding: 12px 0;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: 0.2s ease;
}

.sf-tab-nav button.active {
    color: var(--color-primary);
}

.sf-tab-nav button.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
}

/* ===================================================================
   TABS — CONTENT PANELS
=================================================================== */

.sf-tab-content {
    padding-top: 10px;
}

.sf-tab-panel {
    display: none;
    font-size: 15px;
    line-height: 1.65;
    color: #333;
}

.sf-tab-panel.active {
    display: block;
}

/* Additional Info list */
.sf-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sf-info-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

.sf-product-unitsentence {
    font-size: 15px;
    color: #555;
    margin-top: -6px;
    line-height: 1.45;
}

.sf-product-stats {
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
}

.sf-product-stats .sf-divider {
    color: #bbb;
}

.sf-availability {
    font-weight: 600;
    color: var(--color-primary);
}

.sf-sold {
    font-weight: 500;
}

/* ============================================
   CKEditor / Rich Text Description Styling
   Ensures clean formatting for <p>, <ul>, <li>, <strong>, etc.
============================================ */

.sf-full-description {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
    margin-top: 10px;
}

.sf-full-description p {
    margin: 0 0 14px;
}

.sf-full-description strong {
    font-weight: 600;
    color: #222;
}

.sf-full-description em {
    font-style: italic;
}

.sf-full-description ul,
.sf-full-description ol {
    margin: 10px 0 16px 20px;
    padding: 0;
}

.sf-full-description li {
    margin-bottom: 6px;
    line-height: 1.55;
    color: #444;
}

.sf-full-description li strong {
    font-weight: 600;
    color: #222;
}

/* Handle <br> formatting */
.sf-full-description br {
    line-height: 1.6;
}

/* Bullet spacing fix for nested editors */
.sf-full-description ul ul {
    margin-top: 6px;
    margin-bottom: 6px;
}

/* Prevent long content from overflowing */
.sf-full-description img {
    max-width: 100%;
    border-radius: 6px;
    margin: 10px 0;
}

/* Tables (if CKEditor ever outputs them) */
.sf-full-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.sf-full-description table td,
.sf-full-description table th {
    border: 1px solid #e4e4e4;
    padding: 8px 10px;
    font-size: 14px;
}

.sf-full-description blockquote {
    padding: 12px 16px;
    margin: 18px 0;
    background: #f7f7f7;
    border-left: 4px solid var(--color-primary);
    font-style: italic;
    color: #444;
}

/* Prevent double spacing from CKEditor cleanups */
.sf-full-description *:last-child {
    margin-bottom: 0 !important;
}

/* =========================================================
   MOBILE FLOATING ACTION BAR — FIXED POSITION
========================================================= */

.sf-product-mobile-bar {
    display: none;              /* hidden on desktop */
}

@media (max-width: 768px) {

    .sf-product-mobile-bar {
        display: block !important;
        position: fixed;
        bottom: 0px;
        left: 0;
        right: 0;

        background: #ffffff;
        padding: 12px 14px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
        z-index: 201000;

        width: 100%;
        box-sizing: border-box;
    }

    .sf-mobile-bar-inner {
        display: flex;
        align-items: center;
        gap: 12px;
        max-width: 480px;
        margin: 0 auto; /* ensures it does NOT stretch wider than screen */
    }

    .sf-pqty-mobile {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 120px;
    }

    .sf-add-mobile {
        flex: 1;
        text-align: center;
        padding: 5px 10px;
        font-size: 15px;
        border-radius: 6px;
    }
}

/* hide MOBILE BAR COMPLETELY on desktop */
@media (min-width: 769px) {
    .sf-product-mobile-bar {
        display: none !important;
    }
}

/* =========================================================
   HIDE DESKTOP ACTION BUTTONS ON MOBILE
========================================================= */

/* Hide ONLY the product page desktop buttons on mobile */
@media (max-width: 768px) {
    .sf-product-page .sf-price-row,
    .sf-product-page .sf-row-main-home {
        display: none !important;
    }
}

/* ===================================================================
   RESPONSIVE — MOBILE FIRST
=================================================================== */

@media (max-width: 600px) {
    .sf-product-price {
        font-size: 26px;
    }
    .sf-product-shortdesc {
        font-size: 14px;
    }
    .sf-thumb {
        width: 60px;
        height: 60px;
    }
    .sf-product-page    {
        margin-top: -50px;

    }
}

/* ============================================================
   MOBILE — Place thumbnails BESIDE the main image
============================================================ */
@media (max-width: 600px) {

    .sf-product-main-image {
        width: 100%;
    }

    .sf-product-thumbs {
        display: flex;
        flex-direction: column;     /* vertical stack */
        gap: 8px;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 320px;          /* prevents over-stretch */
        padding-right: 4px;
    }

    .sf-thumb {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
    }
}

.sf-mobile-home-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: none;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sf-mobile-home-btn i {
    width: 22px;
    height: 22px;
    color: #333;
}

.sf-mobile-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* =============================================
   MOBILE FLOATING ACTION BAR — BUTTON SIZING
============================================= */
@media (max-width: 768px) {

    /* QTY container height */
    .sf-pqty-mobile {
        height: 46px; /* adjust as needed */
    }

    /* QTY input field */
    .sf-pqty-mobile .sf-qty-input {
        height: 46px;
        font-size: 16px;
        padding: 0;
        text-align: center;
    }

    /* + / − buttons */
    .sf-pqty-mobile .sf-qty-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
        line-height: 40px;
        border-radius: 6px;
    }

    /* ADD TO CART BUTTON */
    .sf-add-mobile {
        height: 46px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Icon size inside Add to Cart button */
    .sf-add-mobile i {
        width: 20px;
        height: 20px;
    }
}

/* ============================================================
   MOBILE FLOAT BAR — MATCH WIDTH OF QTY GROUP & ADD BUTTON
============================================================ */
@media (max-width: 768px) {

    /* outer container - ensures equal width distribution */
    .sf-mobile-bar-inner {
        display: flex;
        gap: 12px;
        width: 100%;
    }

    /* QTY group takes 50% width */
    .sf-pqty-mobile {
        flex: 1;                   /* makes width equal to add button */
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #fff;
    }

    .sf-pqty-mobile .sf-qty-input {
        flex: 1;
        margin: 0 6px;
        height: 48px;
        text-align: center;
        font-size: 16px;
    }

    .sf-pqty-mobile .sf-qty-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ADD TO CART also takes 50% width */
    .sf-add-mobile {
        flex: 1;            
        height: 48px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 15px;
    }
}


