/* Custom Product Card Styles for Separated Store UI */

/* ============================================================
   VIEW TOGGLE: show/hide the right card type based on container class.
   Journal3 swaps .product-grid / .product-list on .main-products.
   Both card types are always in the DOM; CSS controls which is visible.
   ============================================================ */

/* In GRID mode: hide list cards */
.main-products.product-grid .custom-product-list-layout {
    display: none !important;
}

/* In LIST mode: hide grid cards */
.main-products.product-list .custom-product-grid-card {
    display: none !important;
}

/* Default fallback — if neither class exists yet, show grid cards only */
.main-products:not(.product-list) .custom-product-list-layout {
    display: none !important;
}

.product-layout.custom-product-layout {
    margin-bottom: 25px !important;
    font-family: inherit !important;
    text-align: left !important;
}

.product-layout.custom-product-layout .custom-product-thumb {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.product-layout.custom-product-layout .custom-image-wrap {
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    display: block !important;
    /* Force block to remove any inline-block gap */
}

.product-layout.custom-product-layout .custom-image-wrap a {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.product-layout.custom-product-layout .custom-image-wrap img {
    margin: 0 !important;
    object-fit: cover !important;
    width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1 !important;
    border-radius: 0 !important;
    display: block !important;
}

/* POPULAR badge */
.product-layout.custom-product-layout .custom-popular-badge {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    background: #dd0e1c !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 6px 10px !important;
    border-radius: 6px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    z-index: 2 !important;
    line-height: 1 !important;
}

.product-layout.custom-product-layout .custom-materials-badge {
    position: absolute !important;
    bottom: 15px !important;
    left: 15px !important;
    background: rgba(71, 85, 105, 0.9) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    z-index: 2 !important;
    line-height: 1 !important;
}

.product-layout.custom-product-layout .custom-materials-badge svg {
    margin-right: 5px !important;
}

.product-layout.custom-product-layout .custom-caption {
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    background: #ffffff !important;
    text-align: left !important;
    align-items: flex-start !important;
    /* Prevents center inheritance */
}

div.product-layout.custom-product-layout .custom-category-name,
div.product-layout.custom-product-layout .custom-shape-name {
    color: #dd0e1c !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    margin-bottom: 6px !important;
    text-align: left !important;
    width: 100% !important;
}

div.product-layout.custom-product-layout .custom-product-name {
    text-align: left !important;
    width: 100% !important;
    margin-bottom: 6px !important;
}

div.product-layout.custom-product-layout .custom-product-name a {
    color: #1a202c !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    text-align: left !important;
}

div.product-layout.custom-product-layout .custom-product-desc {
    color: #64748b !important;
    font-size: 10px !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    line-height: 1.5 !important;
    text-align: left !important;
    width: 100% !important;
    display: block !important;
}

.product-layout.custom-product-layout .custom-options-wrap {
    margin-bottom: 15px !important;
    width: 100% !important;
}

.product-layout.custom-product-layout .custom-option-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
}

/* Base Option Pill */
.product-layout.custom-product-layout .custom-option-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 8px !important;
    border-radius: 20px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    background: #f8fafc !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

/* Specific Material Color Mappings */
.product-layout.custom-product-layout .custom-option-pill.pill-cold-rolled-steel {
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    background: #f8fafc !important;
}

.product-layout.custom-product-layout .custom-option-pill.pill-electrogalv-steel {
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
    background: #eff6ff !important;
}

.product-layout.custom-product-layout .custom-option-pill.pill-galvanised-steel {
    border-color: #86efac !important;
    color: #16a34a !important;
    background: #f0fdf4 !important;
}

.product-layout.custom-product-layout .custom-option-pill.pill-304-2b-stainless-steel {
    border-color: #e9d5ff !important;
    color: #9333ea !important;
    background: #faf5ff !important;
}

.product-layout.custom-product-layout .custom-option-pill.pill-316-2b-stainless-steel {
    border-color: #f9a8d4 !important;
    color: #db2777 !important;
    background: #fdf2f8 !important;
}

.product-layout.custom-product-layout .custom-option-pill.pill-aluminium5005 {
    border-color: #fdba74 !important;
    color: #ea580c !important;
    background: #fff7ed !important;
}

.product-layout.custom-product-layout .custom-option-pill.unchecked {
    opacity: 0.25;
}



/* --- Filter Hihglighting (Active/Disabled) --- */
.custom-option-pill.p-active,
.custom-attr-pill.p-active,
.custom-list-material-pill.p-active,
.custom-list-size-pill.p-active {
    background: #ffffff !important;
    border-color: #dd0e1c !important;
    /* Theme Red */
    border-width: 1.5px !important;
    color: #dd0e1c !important;
    font-weight: 700 !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 2px rgba(221, 14, 28, 0.05) !important;
}

.custom-option-pill.p-disabled,
.custom-attr-pill.p-disabled,
.custom-list-material-pill.p-disabled,
.custom-list-size-pill.p-disabled {
    opacity: 0.25 !important;
    filter: grayscale(0.5) !important;
    pointer-events: none !important;
}

/* Sizing options (like 0.5mm, 0.6mm) */
.product-layout.custom-product-layout .custom-option-group[class*="custom-option-thickness"] .custom-option-pill,
.product-layout.custom-product-layout .custom-option-group[class*="custom-option-size"] .custom-option-pill {
    border-radius: 6px !important;
    padding: 6px 6px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
    background: #ffffff !important;
}

/* Attributes Text (Sheet: 2438x1219mm) */
.product-layout.custom-product-layout .custom-attributes,
.product-layout.custom-product-layout .sheet-size {
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin-bottom: 12px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
}

.product-layout.custom-product-layout .custom-attr-pill {
    display: inline-block !important;
}

/* Rating */
.product-layout.custom-product-layout .custom-rating-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    margin-bottom: 20px !important;
    margin-top: auto !important;
    /* push downwards */
    width: 100% !important;
}

.product-layout.custom-product-layout .custom-rating-text {
    font-size: 13px !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

.product-layout.custom-product-layout .rating-stars.custom-stars {
    display: flex !important;
    flex-direction: row !important;
    gap: 2px !important;
    margin: 0 !important;
}

.product-layout.custom-product-layout .rating-stars.custom-stars .fa {
    margin: 0 !important;
    padding: 0 !important;
}

/* Footer Section */
.product-layout.custom-product-layout .custom-footer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-top: auto !important;
    padding-top: 0 !important;
    border-top: none !important;
    width: 100% !important;
}

.product-layout.custom-product-layout .price.custom-price {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.product-layout.custom-product-layout .price-prefix {
    font-size: 13px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
}

.product-layout.custom-product-layout .price-normal,
.product-layout.custom-product-layout .price-new {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.product-layout.custom-product-layout .price-suffix {
    font-size: 13px !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
}

.product-layout.custom-product-layout .btn.custom-select-btn {
    background: #dd0e1c !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    text-decoration: none !important;
    text-transform: none !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    flex-shrink: 0 !important;
}

.product-layout.custom-product-layout .btn.custom-select-btn svg {
    margin-right: 6px !important;
}

.product-layout.custom-product-layout .btn.custom-select-btn:hover {
    background: #ea580c !important;
    color: white !important;
}

/* ============================================================
   LIST VIEW — Custom Product Layout
   Override Journal3's .product-list .product-thumb { display: block }
   ============================================================ */

/* Full-width card row — inside .product-list (flex-wrap container) */
.product-list .product-layout.custom-product-list-layout,
.product-layout.custom-product-list-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
    float: none !important;
    display: block !important;
    padding: 0 !important;
}

/*
 * THE KEY FIX:
 * Journal3 sets: .product-list .product-thumb { display: block }
 * We need a more-specific selector to override it.
 * .product-list .custom-product-list-layout .product-thumb.custom-list-thumb
 * has higher specificity than .product-list .product-thumb
 */
.product-list .custom-product-list-layout .product-thumb.custom-list-thumb,
.custom-product-list-layout .product-thumb.custom-list-thumb {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 190px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    float: none !important;
}

/* ---------- LEFT: Image ---------- */
.custom-product-list-layout .custom-list-image-wrap {
    flex: 0 0 190px !important;
    width: 190px !important;
    min-width: 160px !important;
    background: #f1f5f9 !important;
    overflow: hidden !important;
    float: none !important;
}

.custom-product-list-layout .custom-list-image-wrap a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    float: none !important;
}

.custom-product-list-layout .custom-list-image-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 0 !important;
    margin: 0 !important;
    float: none !important;
    max-width: none !important;
}

/* ---------- MIDDLE: Info ---------- */
.custom-product-list-layout .custom-list-info {
    flex: 1 1 auto !important;
    padding: 16px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

/* Category label + badge row */
.custom-product-list-layout .custom-list-meta-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-product-list-layout .custom-list-category-name {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #dd0e1c !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    line-height: 1 !important;
    display: inline !important;
}

/* POPULAR / NEW badge */
.custom-product-list-layout .custom-list-badge {
    background: #dd0e1c !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 4px 9px !important;
    border-radius: 5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1 !important;
    display: inline-block !important;
}

/* Product name */
.custom-product-list-layout .custom-list-product-name {
    margin: 0 !important;
    padding: 0 !important;
}

.custom-product-list-layout .custom-list-product-name a {
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #1a202c !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    display: block !important;
    text-align: left !important;
}

/* Short description */
.custom-product-list-layout .custom-list-product-desc {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

/* Material pills row */
.custom-product-list-layout .custom-list-material-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
    margin: 0 !important;
}

/* Base material pill */
.custom-product-list-layout .custom-list-material-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    background: #f8fafc !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    float: none !important;
}

/* Solid (active) colours — first 2 pills */
.custom-product-list-layout .custom-list-material-pill.pill-cold-rolled-steel {
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    background: #f8fafc !important;
}

.custom-product-list-layout .custom-list-material-pill.pill-electrogalv-steel {
    border-color: #93c5fd !important;
    color: #1d4ed8 !important;
    background: #eff6ff !important;
}

/* Dimmed colours — less prominent pills (like screenshot greyed-out ones) */
.custom-product-list-layout .custom-list-material-pill.pill-galvanised-steel {
    border-color: #e4e8ed !important;
    color: #94a3b8 !important;
    background: #fafbfc !important;
}

.custom-product-list-layout .custom-list-material-pill.pill-304-stainless-steel {
    border-color: #e4e8ed !important;
    color: #94a3b8 !important;
    background: #fafbfc !important;
}

.custom-product-list-layout .custom-list-material-pill.pill-316-stainless-steel {
    border-color: #e4e8ed !important;
    color: #94a3b8 !important;
    background: #fafbfc !important;
}

.custom-product-list-layout .custom-list-material-pill.pill-aluminium-5005 {
    border-color: #fdba74 !important;
    color: #ea580c !important;
    background: #fff7ed !important;
    opacity: 0.8 !important;
}

/* Rating row */
.custom-product-list-layout .custom-list-rating-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
}

.custom-product-list-layout .custom-list-stars {
    display: flex !important;
    flex-direction: row !important;
    gap: 2px !important;
}

.custom-product-list-layout .custom-list-stars .fa {
    color: #f59e0b !important;
    font-size: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.custom-product-list-layout .custom-list-rating-text {
    font-size: 12px !important;
    color: #64748b !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

/* Thickness / size pills row */
.custom-product-list-layout .custom-list-size-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    align-items: center !important;
    margin: 0 !important;
}

.custom-product-list-layout .custom-list-size-pill {
    display: inline-flex !important;
    align-items: center !important;
    padding: 4px 9px !important;
    border-radius: 5px !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    float: none !important;
}

/* Sheet size / attribute pill — dashed border */
.custom-product-list-layout .custom-list-attr-pill {
    border-style: solid !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    background: #f8fafc !important;
}

/* ---------- RIGHT: Price + CTA ---------- */
.custom-product-list-layout .custom-list-cta {
    flex: 0 0 210px !important;
    width: 210px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    padding: 18px 20px !important;
    border-left: 1px solid #f0f4f8 !important;
    gap: 10px !important;
    float: none !important;
}

.custom-product-list-layout .custom-list-price-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 1px !important;
    width: 100% !important;
}

.custom-product-list-layout .custom-list-price-from {
    font-size: 11px !important;
    color: #94a3b8 !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    display: block !important;
    text-align: right !important;
}

.custom-product-list-layout .custom-list-price-value {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1.1 !important;
    display: block !important;
    text-align: right !important;
}

.custom-product-list-layout .custom-list-price-label {
    font-size: 10px !important;
    color: #94a3b8 !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    display: block !important;
    text-align: right !important;
}

/* Orange CTA button */
.custom-product-list-layout .custom-list-select-btn {
    background: #dd0e1c !important;
    color: #ffffff !important;
    border: none !important;
    padding: 11px 16px !important;
    border-radius: 9px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    text-decoration: none !important;
    text-transform: none !important;
    width: 100% !important;
    box-shadow: none !important;
    outline: none !important;
    white-space: nowrap !important;
    float: none !important;
    line-height: 1.2 !important;
}

.custom-product-list-layout .custom-list-select-btn:hover {
    background: #ea580c !important;
    color: #ffffff !important;
}

/* Save link */
.custom-product-list-layout .custom-list-save-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    justify-content: flex-end !important;
    width: 100% !important;
    transition: color 0.15s ease !important;
    float: none !important;
}

.custom-product-list-layout .custom-list-save-link:hover {
    color: #dd0e1c !important;
}

.custom-product-list-layout .custom-list-save-link svg {
    flex-shrink: 0 !important;
}


/* Responsive: stack vertically on mobile */
@media (max-width: 767px) {

    .product-list .custom-product-list-layout .product-thumb.custom-list-thumb,
    .custom-product-list-layout .product-thumb.custom-list-thumb {
        flex-wrap: wrap !important;
    }

    .custom-product-list-layout .custom-list-image-wrap {
        flex: 0 0 100% !important;
        width: 100% !important;
        height: 220px !important;
    }

    .custom-product-list-layout .custom-list-cta {
        flex: 0 0 100% !important;
        width: 100% !important;
        flex-direction: row !important;
        align-items: center !important;
        border-left: none !important;
        border-top: 1px solid #f0f4f8 !important;
        padding: 14px 16px !important;
        gap: 16px !important;
    }

    .custom-product-list-layout .custom-list-price-block {
        align-items: flex-start !important;
        flex: 1 !important;
    }

    .custom-product-list-layout .custom-list-price-from,
    .custom-product-list-layout .custom-list-price-value,
    .custom-product-list-layout .custom-list-price-label {
        text-align: left !important;
    }

    .custom-product-list-layout .custom-list-select-btn {
        width: auto !important;
        flex-shrink: 0 !important;
    }
}

.custom-product-list-layout .custom-list-select-btn {
    width: auto !important;
    flex-shrink: 0 !important;
}
}