/* ==========================================
   PRODUCT DETAIL PAGE
   ========================================== */
.product-detail-page {
    padding: 40px 0 60px;
    background: #f5f5f5;
    min-height: 60vh;
}

/* ---- Two-Column Layout: Category Sidebar (left) + Product Detail (right) ---- */
.product-detail-page .products-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.product-detail-page .products-sidebar {
    flex: 0 0 260px;
    max-width: 260px;
}

.product-detail-page .products-main {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 767px) {
    .product-detail-page .products-layout {
        flex-direction: column;
    }

    .product-detail-page .products-sidebar {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
    }
}

/* ---- Category Filters Panel ---- */
.product-detail-page .filters-panel {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.product-detail-page .filters-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

    .product-detail-page .filters-section-header h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: #333;
    }

.product-detail-page .filters-reset {
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary, #e53935);
    text-decoration: underline;
}

    .product-detail-page .filters-reset:hover {
        color: #c62828;
    }

.product-detail-page .category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-detail-page .category-list-item {
    border-bottom: 1px solid #f2f2f2;
}

    .product-detail-page .category-list-item:last-child {
        border-bottom: none;
    }

    .product-detail-page .category-list-item a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 4px;
        color: #555;
        text-decoration: none;
        font-size: .92rem;
        transition: color .2s ease;
    }

        .product-detail-page .category-list-item a:hover {
            color: var(--primary, #e53935);
        }

        .product-detail-page .category-list-item a .category-name {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .product-detail-page .category-list-item.active a {
        color: var(--primary, #e53935);
        font-weight: 700;
    }

/* ---- Breadcrumb ---- */
.pd-breadcrumb {
    font-size: .95rem;
    color: #666;
}

    .pd-breadcrumb a {
        color: #666;
        text-decoration: none;
        font-weight: 600;
    }

        .pd-breadcrumb a:hover {
            color: var(--primary, #e53935);
            text-decoration: underline;
        }

    .pd-breadcrumb .breadcrumb-sep {
        color: #bbb;
        margin: 0 8px;
    }

    .pd-breadcrumb .breadcrumb-current {
        color: var(--primary, #e53935);
        font-weight: 700;
    }

/* ---- Image Gallery ---- */
.pd-gallery {
    position: relative;
}

.pd-main-image {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    cursor: crosshair;
}

    .pd-main-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

/* ---- Product Image Hover Popup ----
   Shows the original/full-size product image next to the cursor while
   hovering the main product image. Positioned via JS (left/top),
   so only visual/transition styles live here. Matches the popup used on
   Products.cshtml. */
.product-image-popup {
    position: fixed;
    z-index: 1080;
    display: none;
    max-width: 380px;
    max-height: 380px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
    pointer-events: none;
}

    .product-image-popup.is-visible {
        display: block;
    }

    .product-image-popup img {
        display: block;
        max-width: 360px;
        max-height: 360px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

/* Popup is a desktop-hover-only affordance; disable on touch devices
   where there is no real mouse pointer to hover with. */
@media (hover: none) {
    .product-image-popup {
        display: none !important;
    }
}

.pd-thumb-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pd-thumb {
    width: 78px;
    height: 78px;
    border: 2px solid #ececec;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    transition: border-color .2s ease;
}

    .pd-thumb img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .pd-thumb:hover {
        border-color: var(--primary, #e53935);
    }

    .pd-thumb.active {
        border-color: var(--primary, #e53935);
    }

/* ---- Details Column ---- */
.pd-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}

/* ---- Description ---- */
.pd-description {
    font-size: 1.2rem;
    font-weight: 500;
    color: #222;
    margin-bottom: 6px;
}
.pd-sku {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--primary, #e53935);
    margin-bottom: 12px;
}


.pd-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.pd-stars {
    color: #ddd;
    font-size: .95rem;
}

    .pd-stars .fa-solid.fa-star {
        color: #ffb400;
    }

.pd-review-count {
    color: #777;
    font-size: .9rem;
}

.pd-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.pd-current-price {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary, #e53935);
}

.pd-old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 1.1rem;
}

.pd-availability {
    margin-left: auto;
    font-size: .9rem;
    color: #555;
}

.pd-in-stock {
    color: #2e7d32;
    font-weight: 600;
}

.pd-out-stock {
    color: #c62828;
    font-weight: 600;
}

/* ---- Info Panel ---- */
.pd-info-panel {   
    padding: 16px 20px;
    margin-bottom: 20px;
}

.pd-info-row {
    font-size: .92rem;
    color: #222;
    padding: 4px 0;
}

.pd-info-label {
    font-weight: 700;
    color: #222;
    margin-right: 6px;
}

/* ---- Inline feedback message (add-to-cart result) ---- */
.pd-message {
    padding: 10px 16px;
    border-radius: 4px;
    font-size: .9rem;
    margin-bottom: 16px;
}

.pd-message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.pd-message-error {
    background: #fdecea;
    color: #c62828;
    border: 1px solid #f5c6cb;
}

/* ---- Actions ---- */
.pd-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pd-qty {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.pd-qty-btn {
    width: 38px;
    height: 44px;
    border: none;
    background: #f5f5f5;
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    cursor: pointer;
}

    .pd-qty-btn:hover {
        background: #ececec;
    }

.pd-qty #pdQtyInput {
    width: 60px;
    height: 44px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    -moz-appearance: textfield;
}

.pd-add-cart-btn {
    height: 48px;
    padding: 0 32px;
    border-radius: 4px;
}

    .pd-add-cart-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        transform: none !important;
        box-shadow: none !important;
    }


@media (max-width: 767px) {
    .pd-availability {
        margin-left: 0;
    }
}