.page-wrapper{
    padding:40px 0;
}

.left-image{
    position:sticky;
    top:100px;
}

.left-image img{
    width:95%;
    /*width: auto;*/
    border-radius:16px;
}

/* For small screens */
@media(max-width: 992px){
    .left-image img{
      width:100%;
      border-radius:16px;
  }
}

.options-panel{
    /*max-height:90vh;*/
    overflow-y:auto;
    padding-right:10px;
}

.option-group{
    margin-bottom:35px;
}

.group-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:12px;
}

.group-title{
    font-size:20px;
    font-weight:600;
}

.required-badge{
    background:#E8E8E8;
    color:black;
    padding:4px 12px;
    border-radius:20px;
    font-size:13px;
    font-weight:600;
}



/* Required badge error state */
.required-badge {
    transition: all 0.3s ease;
}

.required-badge.error-badge {
    background-color: #ff4444 !important;
    color: white !important;
}

/* Group header error state */
.group-header.error-header {
    border-left: 3px solid #ff4444 !important;
    padding-left: 12px !important;
}

/* Optional: Add a subtle shake animation for error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.group-header:has(.required-badge[style*="background-color: rgb(255, 68, 68)"]) {
    animation: shake 0.3s ease-in-out;
}

.option-row{
    /*padding:18px 0;*/
    padding:5px 0;
    border-bottom:1px solid #eee;
    display:flex;
    justify-content:space-between;
    align-items:center;
    cursor:pointer;
    transition:0.2s;
}

.option-row:hover{
    background:#fafafa;
}

.option-left{
    display:flex;
    flex-direction:column;
}

.option-title{
    font-weight:500;
}

.option-sub{
    font-size:14px;
    color:#777;
}

.option-right{
    display:flex;
    align-items:center;
    gap:15px;
}

/* Hide native input */
.option-row input{
    display:none;
}

/* Custom radio */
.custom-radio{
    width:22px;
    height:22px;
    border:2px solid #777;
    border-radius:50%;
    position:relative;
}

.option-row input:checked + .custom-radio{
    border-color:#000;
}

.option-row input:checked + .custom-radio::after{
    content:"";
    position:absolute;
    width:10px;
    height:10px;
    background:#000;
    border-radius:50%;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
}

/* Custom checkbox */
.custom-checkbox{
    width:22px;
    height:22px;
    border:2px solid #777;
    border-radius:6px;
    position:relative;
}

.option-row input[type="checkbox"]:checked + .custom-checkbox{
    /*background:#000;
    border-color:#000;*/
    background:#2159AF;
    border-color:#2159AF;
}

.option-row input[type="checkbox"]:checked + .custom-checkbox::after{
    content:"✓";
    color:#fff;
    font-size:14px;
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
}

/* Arrow */
.arrow-icon{
    /*font-size:20px;*/
    font-size:40px;
    color:#aaa;
    cursor:pointer;
    margin-top: -10px;
}

.drawer{
    position:fixed;
    top:0;
    right:-100%;
    width:420px;
    max-width:100%;
    height:100%;
    background:#fff;
    box-shadow:-8px 0 30px rgba(0,0,0,0.2);
    transition:0.35s ease;
    z-index:1050;
    display:flex;
    flex-direction:column;
}

.drawer.active{
    right:0;
}

.drawer-header{
    padding:20px;
    border-bottom:1px solid #eee;
    display:flex;
    justify-content:space-between;
    font-weight:600;
}

.drawer-body{
    flex:1;
    overflow-y:auto;
    padding:20px;
}

.close-btn{
    cursor:pointer;
}

/* Title */
.product-title {
    font-size: 34px;
    font-weight: 700;
}

.price {
    font-size: 20px;
    font-weight: 600;
    margin: 10px 0;
}

/* Rating badge */
.rating-badge {
    background: #2159AF;
    /*color: #0c5460;*/
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
}

/* Bottom bar */
.bottom-bar{
    /*position:fixed;*/
    bottom:0;
    left:0;
    width:100%;
    /*background:#fff;*/
    padding:16px;
    /*box-shadow:0 -4px 20px rgba(0,0,0,0.08);*/
}

.save-main{
    width:100%;
    padding:14px;
    background: #2159AF;
    color:#000;
    border:none;
    border-radius:12px;
    font-weight:600;
    color: #ffffff;
}

@media(max-width:991px){
    .left-image{
        position:relative;
        top:0;
        margin-bottom:25px;
    }

    .product-title {
        font-size: 26px;
    }
}

/* Ensure navbar stays sticky on all pages */
.navbar.sticky-top {
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
    background-color: #fff !important;
}

/* Prevent any margin collapse that might push content above navbar */
body {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure first element after navbar doesn't interfere */
.container.page-wrapper {
    margin-top: 0 !important;
    padding-top: 20px !important;
}

/* Fix for left-image sticky - reduce top value so it doesn't conflict */
.left-image {
    position: sticky;
    top: 80px !important;  /* Changed from 100px to 80px to account for navbar */
}


/* Food product page column layout */
.food-product-layout .left-image {
    width: 100%;
}

.food-product-layout .left-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.food-product-title-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.food-product-title-row .product-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.food-product-title-heart {
    flex: 0 0 auto;
    margin-top: 5px;
}

.food-product-options-panel {
    width: 100%;
    padding-left: 0;
    margin-left: 0;
}

/* --------------------------------------------------------------------------
   Retail product details page
   Scoped to .fg-retail-product-page so the existing food product page styles
   above remain unchanged.
   -------------------------------------------------------------------------- */

.fg-retail-product-page {
    --fg-retail-product-primary: #2159af;
    --fg-retail-product-primary-dark: #123f88;
    --fg-retail-product-ink: #172033;
    --fg-retail-product-muted: #667085;
    --fg-retail-product-line: #e5e9f0;
    --fg-retail-product-soft: #f6f8fc;
    --fg-retail-product-success: #16803c;

    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #fff;
    color: var(--fg-retail-product-ink);
}

.fg-retail-product-page .navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
    background: #fff !important;
}

.fg-retail-product-main {
    padding: 20px 0 48px;
}

.fg-retail-product-container {
    width: 100%;
    max-width: 1500px;
    margin-inline: auto;
    padding-inline: clamp(14px, 2.4vw, 36px);
}

/* Back button */
.fg-retail-product-back-row {
    margin-bottom: 14px;
}

.fg-retail-product-page .back-btn {
    border: 0;
    border-radius: 22px;
    background: var(--fg-retail-product-primary);
    color: #fff;
    padding: 8px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.fg-retail-product-page .back-btn:hover,
.fg-retail-product-page .back-btn:focus-visible {
    background: #1f55a0;
    color: #fff;
}

.fg-retail-product-page .back-btn:hover {
    transform: translateY(-1px);
}

.fg-retail-product-back-button .bi {
    font-size: 18px;
    line-height: 1;
}

/* Main product layout */
.fg-retail-product-main > .fg-retail-product-container > .row {
    align-items: flex-start;
}

.fg-retail-product-image-column {
    position: sticky;
    top: 92px;
}

.fg-retail-product-image-stage {
    position: relative;
    width: 100%;
    min-height: 560px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #edf0f5;
    border-radius: 24px;
    background: #fafbfc;
    display: grid;
    place-items: center;
    cursor: zoom-in;
}

.fg-retail-product-image-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: clamp(16px, 3vw, 42px);
    transition: transform 180ms ease-out;
    will-change: transform;
}

.fg-retail-product-image-stage.is-zooming img {
    transform: scale(1.8);
}

.fg-retail-product-image-status {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 3;
    border-radius: 999px;
    background: rgba(31, 41, 55, .92);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
}

.fg-retail-product-zoom-hint {
    margin: 10px 0 0;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--fg-retail-product-muted);
    font-size: 12px;
}

/* Product summary */
.fg-retail-product-summary,
.fg-retail-product-title-copy,
.fg-retail-product-details-content {
    min-width: 0;
}

.fg-retail-product-summary {
    width: 100%;
    max-width: 670px;
    padding-bottom: 0;
}

.fg-retail-product-context {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.fg-retail-product-shop-context {
    margin: 0 0 10px;
}

.fg-retail-product-shop-link {
    color: #253047;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.fg-retail-product-shop-link:hover {
    color: var(--fg-retail-product-primary);
}

.fg-retail-product-shop-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--fg-retail-product-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.fg-retail-product-shop-link > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.fg-retail-product-shop-link strong {
    overflow-wrap: anywhere;
    font-size: 14px;
    font-weight: 700;
}

.fg-retail-product-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
}

.fg-retail-product-brand {
    margin: 0 0 7px;
    color: var(--fg-retail-product-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.fg-retail-product-title-row h1 {
    margin: 0;
    color: #101828;
    overflow-wrap: anywhere;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.fg-retail-product-title-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.fg-retail-product-stock {
    min-height: 32px;
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
}

.fg-retail-product-stock.is-available {
    background: #e8f8ee;
    color: var(--fg-retail-product-success);
}

.fg-retail-product-stock.is-unavailable {
    background: #ffe5e9;
    color: #ff0000;
}

.fg-retail-product-favourite {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--fg-retail-product-line);
    border-radius: 50%;
    background: #fff;
    color: #344054;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .08);
}

.fg-retail-product-favourite.active,
.fg-retail-product-favourite[aria-pressed="true"] {
    color: #e11d48;
}

.fg-retail-product-category-context {
    margin: 10px 0 0;
}

.fg-retail-product-category-text {
    color: var(--fg-retail-product-muted);
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    line-height: 1.45;
}

.fg-retail-product-category-text .bi {
    margin-top: 2px;
    color: var(--fg-retail-product-primary);
}

/* Pricing */
.fg-retail-product-price-block {
    margin-top: 22px;
}

.fg-retail-product-price-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.fg-retail-product-price-line strong {
    color: #101828;
    font-size: 27px;
    font-weight: 800;
}

.fg-retail-product-price-line del {
    color: #858d9d;
    font-size: 16px;
}

.fg-retail-product-discount {
    border-radius: 7px;
    background: #e21b22;
    color: #fff;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 800;
}

.fg-retail-product-secondary-price {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--fg-retail-product-muted);
    font-size: 14px;
}

.fg-retail-product-secondary-price span + span::before {
    content: "•";
    margin-right: 8px;
}

.fg-retail-product-delivery-charge {
    margin: 10px 0 0;
    color: var(--fg-retail-product-muted);
    font-size: 12px;
}

/* Details */
.fg-retail-product-details-section {
    margin: 30px 0 0;
    padding: 22px 0;
    border-top: 1px solid var(--fg-retail-product-line);
}

.fg-retail-product-details-section > h2 {
    margin: 0 0 12px;
    color: #101828;
    font-size: 20px;
    font-weight: 750;
    line-height: 1.25;
}

.fg-retail-product-description {
    color: #5f6368;
    font-size: 15px;
    line-height: 1.65;
}

.fg-retail-product-description p {
    margin: 0;
}

.fg-retail-product-detail-points {
    margin: 18px 0 0;
    padding-left: 20px;
    color: #5f6368;
    font-size: 14px;
    line-height: 1.6;
}

.fg-retail-product-detail-points li + li {
    margin-top: 5px;
}

.fg-retail-product-detail-points strong {
    color: #344054;
    font-weight: 650;
}

/* Product information card was removed from the retail template. */
.fg-retail-product-page .fg-retail-product-information-card {
    display: none !important;
}

/* Quantity */
.fg-retail-product-purchase-section {
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--fg-retail-product-line);
}

.fg-retail-product-purchase-section .fg-retail-product-quantity-label {
    margin: 0 0 8px;
    display: block;
    color: #344054;
    font-size: 12px;
    font-weight: 750;
}

.fg-retail-product-quantity {
    width: 90px;
    min-height: 46px;
    border-color: var(--fg-retail-product-line);
    border-radius: 999px;
    background-color: #f3f4f6;
    font-weight: 700;
}

/* Add button outside the form, matching product-details.php structure. */
.fg-retail-product-page .bottom-bar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    inset: auto !important;
    width: 100%;
    margin: 24px 0 0;
    padding: 16px;
    background: transparent;
    box-shadow: none;
    z-index: auto;
}

.fg-retail-product-page .bottom-bar .container {
    display: block !important;
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
}

.fg-retail-product-page .bottom-bar .save-main {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    min-height: 56px;
    padding: 14px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--fg-retail-product-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    transition: background-color .2s ease, transform .2s ease;
}

.fg-retail-product-page .bottom-bar .save-main:hover {
    background: #1c4d99;
    color: #fff;
}

.fg-retail-product-page .bottom-bar .save-main:active {
    transform: translateY(1px);
}

.fg-retail-product-page .bottom-bar .fg-retail-product-unavailable-button {
    display: flex !important;
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #eceff3;
    color: #737b89;
    font-size: 15px;
    font-weight: 700;
    cursor: not-allowed;
}

/* Modal */
.fg-retail-product-modal {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
}

.fg-retail-product-primary-button {
    background: var(--fg-retail-product-primary);
    color: #fff;
}

.fg-retail-product-primary-button:hover {
    background: var(--fg-retail-product-primary-dark);
    color: #fff;
}

/* Tablet and smaller: force a single-column layout. This deliberately
   overrides Bootstrap's col-lg-6 behaviour for the retail page only. */
@media (max-width: 1199.98px) {
    .fg-retail-product-main > .fg-retail-product-container > .row {
        flex-wrap: wrap !important;
    }

    .fg-retail-product-main > .fg-retail-product-container > .row > .col-12.col-lg-6 {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .fg-retail-product-image-column {
        position: static !important;
        top: auto !important;
    }

    .fg-retail-product-image-stage {
        max-width: 720px;
        min-height: 0;
        margin-inline: auto;
        cursor: default;
    }

    .fg-retail-product-summary {
        max-width: 720px;
        margin-inline: auto;
        padding-top: 4px;
    }
}

@media (max-width: 767.98px) {
    .fg-retail-product-main {
        padding: 12px 0 28px;
    }

    .fg-retail-product-container {
        padding-inline: 14px;
    }

    .fg-retail-product-main > .fg-retail-product-container > .row {
        --bs-gutter-x: 0;
        --bs-gutter-y: 1.25rem;
        margin-right: 0;
        margin-left: 0;
    }

    .fg-retail-product-back-row {
        margin-bottom: 10px;
    }

    .fg-retail-product-page .back-btn {
        padding: 7px 13px;
        font-size: 12px;
    }

    .fg-retail-product-image-stage {
        width: 100%;
        border-radius: 18px;
    }

    .fg-retail-product-image-stage img {
        padding: 16px;
    }

    .fg-retail-product-shop-context {
        margin-bottom: 8px;
    }

    /*
     * Keep the product title in the left column and keep the stock badge
     * plus favourite button in the right column on mobile.
     */
    .fg-retail-product-page .fg-retail-product-title-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) max-content !important;
        align-items: start !important;
        column-gap: 10px !important;
        row-gap: 0 !important;
    }

    .fg-retail-product-page .fg-retail-product-title-copy {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
    }

    .fg-retail-product-page .fg-retail-product-title-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;
        align-self: start !important;
        gap: 7px !important;
        width: max-content !important;
        padding-top: 0 !important;
        margin: 0 !important;
    }

    .fg-retail-product-title-row h1 {
        font-size: 28px;
        line-height: 1.12;
        letter-spacing: -.025em;
    }

    .fg-retail-product-title-actions .fg-retail-product-favourite {
        flex-basis: 43px;
        width: 43px;
        height: 43px;
        font-size: 19px;
    }

    .fg-retail-product-category-text {
        flex-wrap: wrap;
    }

    .fg-retail-product-details-section {
        margin-top: 24px;
        padding: 18px 0;
    }

    .fg-retail-product-purchase-section {
        margin-top: 22px;
        padding-top: 20px;
    }

    .fg-retail-product-page .bottom-bar {
        margin-top: 18px;
        padding: 12px 14px;
    }

    .fg-retail-product-page .bottom-bar .container {
        max-width: none;
        padding-inline: 0;
    }
}

@media (max-width: 575.98px) {
    .fg-retail-product-container {
        padding-inline: 12px;
    }

    .fg-retail-product-image-stage {
        border-radius: 15px;
    }

    .fg-retail-product-image-stage img {
        padding: 12px;
    }

    .fg-retail-product-shop-link {
        gap: 8px;
    }

    .fg-retail-product-shop-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 15px;
    }

    .fg-retail-product-shop-link strong {
        font-size: 13px;
    }

    .fg-retail-product-title-row h1 {
        font-size: 25px;
    }

    .fg-retail-product-page .fg-retail-product-title-row {
        column-gap: 8px !important;
    }

    .fg-retail-product-page .fg-retail-product-title-actions {
        gap: 6px !important;
    }

    .fg-retail-product-title-actions .fg-retail-product-stock {
        min-height: 27px;
        padding: 4px 7px;
        font-size: 9px;
    }

    .fg-retail-product-title-actions .fg-retail-product-favourite {
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        font-size: 17px;
    }

    .fg-retail-product-category-context {
        margin-top: 8px;
    }

    .fg-retail-product-category-text {
        font-size: 11px;
        line-height: 1.5;
    }

    .fg-retail-product-price-block {
        margin-top: 18px;
    }

    .fg-retail-product-price-line strong {
        font-size: 24px;
    }

    .fg-retail-product-secondary-price {
        font-size: 12px;
    }

    .fg-retail-product-details-section > h2 {
        font-size: 18px;
    }

    .fg-retail-product-description,
    .fg-retail-product-detail-points {
        font-size: 14px;
        line-height: 1.6;
    }

    .fg-retail-product-quantity {
        width: 100px;
        min-height: 46px;
    }

    .fg-retail-product-page .bottom-bar .save-main,
    .fg-retail-product-page .bottom-bar .fg-retail-product-unavailable-button {
        min-height: 52px;
        padding: 13px 14px;
        border-radius: 11px;
        font-size: 14px;
    }
}

/* Very narrow phones: keep both controls in the right-hand title column.
   They stack vertically only when horizontal space is extremely limited. */
@media (max-width: 399.98px) {
    .fg-retail-product-page .fg-retail-product-title-actions {
        flex-direction: column !important;
        align-items: flex-end !important;
    }
}
