.item-page {
    padding: 1.25rem 1rem 6.5rem;
}

.item-breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.item-breadcrumbs a {
    color: #166816;
    text-decoration: none;
}

.item-top {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.item-left,
.item-right,
.item-block,
.related-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.item-left,
.item-right {
    padding: 1rem;
}

.item-title {
    margin: 0 0 .85rem;
    color: #166816;
    font-size: 1.7rem;
}

.item-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .85rem;
}

.badge-stock,
.badge-tag {
    border-radius: 999px;
    padding: .35rem .7rem;
    font-size: .78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.badge-stock.in { background: #EAF7ED; color: #1b5e20; }
.badge-stock.low { background: #FFF4E5; color: #e65100; }
.badge-stock.out { background: #FDECEA; color: #c62828; }
.badge-tag { background: #EAF5FF; color: #0d47a1; }

.item-price {
    margin: .7rem 0 1rem;
    font-size: 1.55rem;
    font-weight: 800;
    color: #166816;
}

.negotiable-text {
    font-size: 1.05rem;
    color: #f57f17;
    font-weight: 700;
}

.item-qty-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.item-qty-row input {
    width: 90px;
    padding: .45rem .6rem;
    border: 1px solid #d7dee6;
    border-radius: 8px;
}

.item-cta-group {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}

.btn-primary-cta,
.btn-secondary-cta {
    border: 0;
    border-radius: 10px;
    padding: .68rem 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary-cta {
    background: linear-gradient(135deg, #1f8a32, #166816);
    color: #fff;
    min-height: 42px;
}

.btn-buy-now {
    background: linear-gradient(135deg, #0f7a2d, #166816);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: .68rem 1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn-buy-now:hover {
    box-shadow: 0 8px 20px rgba(22, 104, 22, 0.25);
    transform: translateY(-1px);
}

.btn-buy-now:active {
    transform: translateY(0);
}

.btn-buy-now:disabled {
    opacity: .65;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary-cta {
    background: #f4f7fb;
    color: #174f1f;
    min-height: 42px;
}

.btn-primary-cta.is-disabled {
    background: #c7ced6;
    color: #4d5763;
    cursor: not-allowed;
}

.item-note {
    margin-top: .9rem;
    color: #5f6c79;
    font-size: .9rem;
}

.fixed-price-display {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.price-label {
    font-size: 0.85rem;
    color: #5c6c76;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.price-value {
    font-size: 1.6rem;
    color: #166816;
    font-weight: 800;
    line-height: 1.1;
}

.item-sections {
    margin-top: 1.35rem;
    display: grid;
    gap: 1rem;
}

.item-block {
    padding: 1rem;
}

.item-block h2,
.related-section h2 {
    margin: 0 0 .65rem;
    font-size: 1.05rem;
    color: #1f2f3f;
}

.item-block ul {
    margin: 0;
    padding-left: 1.2rem;
}

.related-section {
    margin-top: 1rem;
    padding: 1rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
}

.related-card {
    border: 1px solid #e4ebf2;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    background: #fff;
}

.related-image {
    height: 130px;
    background: #f6faf6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.related-info {
    padding: .6rem .7rem;
}

.related-info h3 {
    margin: 0 0 .35rem;
    font-size: .92rem;
}

.related-info p {
    margin: 0;
    font-size: .86rem;
    color: #21652f;
    font-weight: 700;
}

.story-list {
    display: grid;
    gap: .55rem;
}

.story-link {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    text-decoration: none;
    background: #f7fafc;
    border-radius: 8px;
    padding: .55rem .7rem;
    color: #1f2f3f;
}

.empty-note {
    color: #6f7a86;
    margin: 0;
}

/* Gallery */
.item-gallery-main {
    width: 100%;
    height: clamp(300px, 44vw, 420px);
    min-height: 300px;
    max-height: 420px;
    background: #f4f8f4;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-main-image,
.gallery-main-video {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-main-image {
    object-fit: contain;
}

.gallery-main-video {
    object-fit: contain;
    background: #000;
    border: 0;
}

.item-gallery-thumbs {
    margin-top: .75rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: .5rem;
}

.gallery-thumb {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: #eef4ee;
    cursor: pointer;
    position: relative;
    height: 74px;
}

.gallery-thumb.active {
    border-color: #1f8a32;
}

.gallery-thumb img,
.gallery-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-video-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1877f2, #0f5cc0);
    color: #fff;
    font-size: 1.15rem;
}

.thumb-video-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0,0,0,.5);
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
}

.sticky-cta-mobile {
    display: none;
}

@media (max-width: 992px) {
    .item-top {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .item-page {
        padding-bottom: 5.5rem;
    }

    .item-left,
    .item-right,
    .item-block,
    .related-section {
        border-radius: 12px;
    }

    .item-gallery-main {
        height: clamp(230px, 65vw, 300px);
        min-height: 230px;
        max-height: 300px;
    }

    .item-gallery-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    }

    .gallery-thumb {
        height: 62px;
    }

    .item-title {
        font-size: 1.4rem;
    }

    .item-price {
        font-size: 1.3rem;
    }

    .sticky-cta-mobile {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        border-top: 1px solid #dfe7ee;
        padding: .6rem .8rem;
        z-index: 999;
    }

    .sticky-cta-mobile .btn-primary-cta {
        width: 100%;
        min-height: 46px;
        font-size: .96rem;
    }

    .sticky-cta-mobile .btn-buy-now {
        width: 100%;
        min-height: 46px;
        font-size: .96rem;
    }

    .item-cta-group {
        display: none;
    }
}

/* Fixed checkout modal (Buy Now flow) */
.fixed-checkout-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 1rem;
}

.fixed-checkout-modal.active {
    display: flex;
}

.fixed-checkout-dialog {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    padding: 1rem 1rem 1.1rem;
    position: relative;
}

.fixed-checkout-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: #7a8892;
    cursor: pointer;
}

.fixed-checkout-dialog h3 {
    margin: 0 1.6rem 0.25rem 0;
    color: #143b1f;
}

.fixed-checkout-subtitle {
    margin: 0 0 .9rem;
    color: #687783;
    font-size: .9rem;
}

.fixed-checkout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .55rem 0;
    border-bottom: 1px solid #eef2f5;
}

.fixed-checkout-qty-row {
    align-items: center;
}

.fixed-checkout-qty-row input {
    width: 92px;
    border: 1px solid #d9e1e8;
    border-radius: 8px;
    padding: .45rem .55rem;
}

.fixed-checkout-total-row strong {
    color: #166816;
    font-size: 1.15rem;
}

.fixed-checkout-note {
    margin: .75rem 0 1rem;
    font-size: .85rem;
    color: #5f6d78;
}

.fixed-checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.fixed-checkout-actions .btn-secondary-cta,
.fixed-checkout-actions .btn-buy-now {
    width: 100%;
}

@media (max-width: 560px) {
    .fixed-checkout-dialog {
        max-width: 100%;
        border-radius: 14px;
        padding: .95rem;
    }
}
