.slj-aapm-section,
.slj-aapm-single {
    --slj-primary: #176b45;
    --slj-accent: #d4a017;
    --slj-button-text: #fff;
    --slj-radius: 18px;
    color: #1f2d26;
    font-family: inherit;
}

.slj-aapm-section,
.slj-aapm-section *,
.slj-aapm-single,
.slj-aapm-single * {
    box-sizing: border-box;
}

/* Shortcode section */
.slj-aapm-section {
    width: 100%;
    margin: 32px 0;
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    border: 1px solid #e5ede8;
    border-radius: 26px;
    background:
        radial-gradient(circle at 100% 0, rgba(212, 160, 23, .08), transparent 28%),
        linear-gradient(180deg, #fbfdfc 0%, #f6faf7 100%);
}

.slj-aapm-section-header {
    max-width: 760px;
    margin: 0 auto 24px;
    text-align: center;
}

.slj-aapm-section-header h2 {
    margin: 0 0 8px !important;
    color: var(--slj-primary) !important;
    font-size: clamp(1.65rem, 3vw, 2.25rem) !important;
    font-weight: 800 !important;
    letter-spacing: -.025em;
    line-height: 1.16 !important;
}

.slj-aapm-section-header p {
    margin: 0 !important;
    color: #5d6b64;
    font-size: 1rem;
    line-height: 1.65;
}

.slj-aapm-grid {
    display: grid;
    grid-template-columns: repeat(var(--slj-cols, 3), minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    align-items: stretch;
}

.slj-aapm-grid.is-single-product {
    grid-template-columns: minmax(0, 940px);
    justify-content: center;
}

.slj-aapm-grid.is-two-products {
    grid-template-columns: repeat(2, minmax(0, 460px));
    justify-content: center;
}

.slj-aapm-card {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e1e9e4;
    border-radius: var(--slj-radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 61, 43, .07);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.slj-card-style-elevated .slj-aapm-card,
.slj-aapm-related .slj-aapm-card {
    box-shadow: 0 11px 30px rgba(17, 59, 42, .09);
}

.slj-card-style-outlined .slj-aapm-card {
    border: 2px solid #dfe9e3;
    box-shadow: none;
}

.slj-card-style-minimal .slj-aapm-card {
    border-color: transparent;
    background: #f7faf8;
    box-shadow: none;
}

.slj-aapm-card:hover {
    transform: translateY(-3px);
    border-color: rgba(23, 107, 69, .3);
    box-shadow: 0 16px 38px rgba(17, 59, 42, .13);
}

.slj-aapm-card-image {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    border-bottom: 1px solid #edf2ef;
    background: linear-gradient(145deg, #fff 0%, #f2f6f3 100%);
}

.slj-image-square .slj-aapm-card-image { aspect-ratio: 1 / 1; }
.slj-image-portrait .slj-aapm-card-image { aspect-ratio: 4 / 5; }
.slj-image-landscape .slj-aapm-card-image { aspect-ratio: 16 / 10; }

.slj-aapm-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 10px;
    object-fit: contain;
    transition: transform .25s ease;
}

.slj-aapm-card:hover .slj-aapm-card-image img { transform: scale(1.025); }

.slj-aapm-placeholder {
    display: grid;
    width: 100%;
    min-height: 230px;
    height: 100%;
    place-items: center;
    color: #93a29a;
}

.slj-aapm-placeholder .dashicons {
    width: 58px;
    height: 58px;
    font-size: 58px;
}

.slj-aapm-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 24px);
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--slj-accent);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .13);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .015em;
    line-height: 1.2;
}

.slj-aapm-card-body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    padding: 18px;
}

.slj-aapm-card-category {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
    color: var(--slj-primary);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    line-height: 1.3;
    text-transform: uppercase;
}

.slj-aapm-card-category .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

.slj-aapm-card-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 9px !important;
    color: #17251e !important;
    font-size: 1.12rem !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.slj-aapm-card-title a {
    color: inherit !important;
    text-decoration: none !important;
}

.slj-aapm-card-title a:hover { color: var(--slj-primary) !important; }

.slj-aapm-best-for {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f1f7f3;
    color: #4f6157;
    font-size: .82rem;
    line-height: 1.45;
}

.slj-aapm-best-for .dashicons {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--slj-primary);
    font-size: 15px;
}

.slj-aapm-card-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 16px !important;
    color: #59665f;
    font-size: .91rem;
    line-height: 1.58;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.slj-aapm-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: auto;
}

.slj-aapm-button {
    display: inline-flex !important;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    transition: transform .15s ease, filter .2s ease, background .2s ease, border-color .2s ease;
}

.slj-aapm-button:hover { transform: translateY(-1px); }

.slj-aapm-button-primary {
    border: 2px solid var(--slj-primary);
    background: var(--slj-primary);
    color: var(--slj-button-text) !important;
}

.slj-aapm-button-primary:hover { filter: brightness(.93); }

.slj-aapm-button-secondary {
    border: 2px solid #cbdad1;
    background: #fff;
    color: var(--slj-primary) !important;
}

.slj-aapm-button-secondary:hover {
    border-color: var(--slj-primary);
    background: #f2f8f4;
}

.slj-aapm-button .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* A single result becomes a useful compact horizontal recommendation instead
   of occupying one narrow column with a large empty area beside it. */
.slj-aapm-grid.is-horizontal-single .slj-aapm-card {
    display: grid;
    grid-template-columns: minmax(250px, 38%) minmax(0, 1fr);
    min-height: 330px;
}

.slj-aapm-grid.is-horizontal-single .slj-aapm-card-image {
    height: 100%;
    border-right: 1px solid #edf2ef;
    border-bottom: 0;
    aspect-ratio: auto;
}

.slj-aapm-grid.is-horizontal-single .slj-aapm-card-body {
    justify-content: center;
    padding: clamp(22px, 4vw, 36px);
}

.slj-aapm-grid.is-horizontal-single .slj-aapm-card-title {
    font-size: clamp(1.35rem, 2.4vw, 1.85rem) !important;
    -webkit-line-clamp: 2;
}

.slj-aapm-grid.is-horizontal-single .slj-aapm-card-description {
    max-width: 620px;
    font-size: .98rem;
    -webkit-line-clamp: 5;
}

.slj-aapm-grid.is-horizontal-single .slj-aapm-card-actions {
    grid-template-columns: repeat(2, minmax(140px, 190px));
    justify-content: start;
}

.slj-aapm-disclosure {
    width: 100%;
    max-width: 940px;
    margin: 18px auto 0 !important;
    padding: 11px 14px;
    border: 1px solid #e9e1c2;
    border-radius: 10px;
    background: #faf8ef;
    color: #6b6245;
    font-size: .79rem;
    line-height: 1.5;
}

.slj-aapm-empty {
    padding: 18px;
    border: 1px dashed #c7d1cb;
    border-radius: 12px;
    background: #f7faf8;
}

/* Detailed product page */
.slj-aapm-single {
    width: 100% !important;
    max-width: none !important;
    padding: 30px 18px 70px;
    background: linear-gradient(180deg, #f5faf7 0, #fff 310px);
}

.slj-aapm-single-container {
    width: min(100%, 1180px) !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
}

.slj-aapm-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    color: #728078;
    font-size: .82rem;
}

.slj-aapm-breadcrumbs a {
    color: var(--slj-primary) !important;
    text-decoration: none !important;
}

.slj-aapm-product-hero {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(28px, 5vw, 52px);
    width: 100%;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid #e2ebe6;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(19, 64, 45, .09);
}

.slj-aapm-product-media,
.slj-aapm-product-summary,
.slj-aapm-detail-main,
.slj-aapm-buy-panel { min-width: 0; }

.slj-aapm-main-image {
    display: grid !important;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid #e6ece8;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #f3f6f4);
    place-items: center;
    text-decoration: none !important;
}

.slj-aapm-main-image img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 8px;
    object-fit: contain;
}

.slj-aapm-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
}

.slj-aapm-thumb {
    width: 66px;
    height: 66px;
    overflow: hidden;
    padding: 3px;
    cursor: pointer;
    border: 2px solid #dce7e0;
    border-radius: 10px;
    background: #fff;
}

.slj-aapm-thumb.is-active,
.slj-aapm-thumb:hover { border-color: var(--slj-primary); }

.slj-aapm-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slj-aapm-gallery-note {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 9px 0 0 !important;
    color: #708078;
    font-size: .78rem;
}

.slj-aapm-gallery-note .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.slj-aapm-summary-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.slj-aapm-category-pill,
.slj-aapm-badge-static {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    box-shadow: none;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2;
}

.slj-aapm-category-pill {
    background: #e8f3ec;
    color: var(--slj-primary);
}

.slj-aapm-category-pill .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
}

.slj-aapm-product-summary h1 {
    margin: 0 0 15px !important;
    color: #13271c !important;
    font-size: clamp(2rem, 4vw, 3.15rem) !important;
    font-weight: 800 !important;
    letter-spacing: -.035em;
    line-height: 1.08 !important;
}

.slj-aapm-lead {
    margin: 0 0 17px !important;
    color: #526159;
    font-size: 1.03rem;
    line-height: 1.7;
}

.slj-aapm-best-for-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 17px;
    padding: 12px 14px;
    border-left: 4px solid var(--slj-accent);
    border-radius: 0 11px 11px 0;
    background: #f3f8f5;
}

.slj-aapm-best-for-box strong {
    color: #6b745f;
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.slj-aapm-quick-features {
    display: grid;
    gap: 8px;
    margin: 0 0 21px !important;
    padding: 0 !important;
    list-style: none !important;
}

.slj-aapm-quick-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 !important;
    line-height: 1.45;
}

.slj-aapm-quick-features .dashicons {
    flex: 0 0 auto;
    color: var(--slj-primary);
}

.slj-aapm-hero-buy {
    min-width: 205px;
    padding: 13px 20px;
    font-size: .96rem;
}

.slj-aapm-inline-disclosure {
    max-width: 520px;
    margin: 10px 0 0 !important;
    color: #7a817d;
    font-size: .72rem;
    line-height: 1.45;
}

.slj-aapm-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    width: 100%;
    margin-top: 30px;
    align-items: start;
}

.slj-aapm-detail-main {
    width: 100% !important;
    max-width: none !important;
}

.slj-aapm-content-section {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 20px !important;
    padding: clamp(22px, 3vw, 30px);
    border: 1px solid #e2eae5;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(22, 60, 43, .035);
}

.slj-aapm-section-kicker {
    margin-bottom: 6px;
    color: var(--slj-primary);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.slj-aapm-content-section h2,
.slj-aapm-related > h2 {
    margin: 0 0 17px !important;
    color: #173a2a !important;
    font-size: clamp(1.35rem, 2.2vw, 1.65rem) !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}

.slj-aapm-prose {
    width: 100%;
    color: #3f4e46;
    line-height: 1.78;
}

.slj-aapm-prose > *:first-child { margin-top: 0 !important; }
.slj-aapm-prose > *:last-child { margin-bottom: 0 !important; }
.slj-aapm-prose img { max-width: 100%; height: auto; border-radius: 12px; }

.slj-aapm-feature-grid,
.slj-aapm-benefit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    width: 100%;
}

.slj-aapm-feature,
.slj-aapm-benefit {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 9px;
    padding: 14px;
    border: 1px solid #eaf0ec;
    border-radius: 12px;
    background: #f5f9f6;
}

.slj-aapm-feature .dashicons { color: var(--slj-primary); }
.slj-aapm-benefit .dashicons { color: var(--slj-accent); }

.slj-aapm-feature .dashicons,
.slj-aapm-benefit .dashicons {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    font-size: 18px;
}

.slj-aapm-feature p,
.slj-aapm-benefit p {
    min-width: 0;
    margin: 0 !important;
    color: #415048;
    font-size: .91rem;
    line-height: 1.52;
}

.slj-aapm-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.slj-aapm-details-grid.is-long-form { grid-template-columns: 1fr; }

.slj-aapm-detail-row {
    width: 100%;
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid #e0e9e3;
    border-left: 4px solid var(--slj-primary);
    border-radius: 12px;
    background: #fbfdfc;
}

.slj-aapm-detail-row h3 {
    margin: 0 !important;
    color: #1c3a2b !important;
    font-size: .95rem !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
}

.slj-aapm-detail-row p {
    margin: 7px 0 0 !important;
    color: #536159;
    font-size: .9rem;
    line-height: 1.6;
}

.slj-aapm-buy-panel { width: 100%; }

.slj-aapm-buy-card {
    position: sticky;
    top: 28px;
    width: 100%;
    padding: 23px;
    border-radius: 18px;
    background: linear-gradient(145deg, #173e2c, #0f3021);
    box-shadow: 0 16px 40px rgba(13, 50, 34, .2);
    color: #fff;
}

.slj-aapm-buy-card-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    font-size: 22px;
    line-height: 42px;
    place-items: center;
}

.slj-aapm-buy-card h2 {
    margin: 0 0 9px !important;
    color: #fff !important;
    font-size: 1.22rem !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
}

.slj-aapm-buy-card p {
    margin: 0 0 15px !important;
    color: #d9e7de;
    font-size: .89rem;
    line-height: 1.62;
}

.slj-aapm-buy-card .slj-aapm-button {
    width: 100%;
    border-color: var(--slj-accent);
    background: var(--slj-accent);
}

.slj-aapm-buy-card ul {
    margin: 16px 0 0 !important;
    padding-left: 18px !important;
    color: #dce9e1;
    font-size: .82rem;
    line-height: 1.75;
}

.slj-aapm-related {
    width: 100%;
    margin-top: 38px;
}

.slj-aapm-related .slj-aapm-card-image { aspect-ratio: 1 / 1; }
.slj-aapm-related .slj-aapm-card { background: #fff; }

/* Stronger theme containment for GeneratePress and other content wrappers. */
.slj-aapm-product-page .entry-content,
.slj-aapm-product-page .site-content,
.slj-aapm-product-page .content-area,
.slj-aapm-product-page .site-main,
.slj-aapm-product-page article,
.slj-aapm-product-page .inside-article {
    max-width: none;
}

.slj-aapm-product-page .slj-aapm-single a:focus-visible {
    outline: 3px solid var(--slj-accent);
    outline-offset: 3px;
}

@media (max-width: 1000px) {
    .slj-aapm-grid { grid-template-columns: repeat(var(--slj-tablet-cols, 2), minmax(0, 1fr)); }
    .slj-aapm-grid.is-single-product { grid-template-columns: minmax(0, 860px); }
    .slj-aapm-grid.is-two-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .slj-aapm-product-hero { grid-template-columns: 1fr 1fr; gap: 28px; }
    .slj-aapm-detail-grid { grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; }
}

@media (max-width: 820px) {
    .slj-aapm-product-hero { grid-template-columns: 1fr; align-items: start; }
    .slj-aapm-product-media { width: min(100%, 620px); margin: 0 auto; }
    .slj-aapm-detail-grid { grid-template-columns: 1fr; }
    .slj-aapm-buy-card { position: static; }
}

@media (max-width: 700px) {
    .slj-aapm-grid.is-horizontal-single .slj-aapm-card {
        display: flex;
        min-height: 0;
    }

    .slj-aapm-grid.is-horizontal-single .slj-aapm-card-image {
        border-right: 0;
        border-bottom: 1px solid #edf2ef;
        aspect-ratio: 1 / 1;
    }

    .slj-aapm-grid.is-horizontal-single .slj-aapm-card-body { padding: 20px; }
    .slj-aapm-grid.is-horizontal-single .slj-aapm-card-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .slj-aapm-section {
        margin: 24px 0;
        padding: 16px;
        border-radius: 18px;
    }

    .slj-aapm-section-header {
        margin-bottom: 18px;
        text-align: left;
    }

    .slj-aapm-section-header h2 { font-size: 1.55rem !important; }
    .slj-aapm-section-header p { font-size: .93rem; line-height: 1.55; }

    .slj-aapm-grid,
    .slj-aapm-grid.is-two-products {
        grid-template-columns: repeat(var(--slj-mobile-cols, 1), minmax(0, 1fr));
        gap: 15px;
    }

    .slj-aapm-card-actions,
    .slj-aapm-grid.is-horizontal-single .slj-aapm-card-actions { grid-template-columns: 1fr; }

    .slj-aapm-single { padding: 18px 10px 50px; }
    .slj-aapm-breadcrumbs { margin-bottom: 15px; }
    .slj-aapm-product-hero { padding: 15px; border-radius: 18px; }
    .slj-aapm-product-summary h1 { font-size: 1.9rem !important; }
    .slj-aapm-content-section { padding: 19px; border-radius: 15px; }

    .slj-aapm-feature-grid,
    .slj-aapm-benefit-grid,
    .slj-aapm-details-grid { grid-template-columns: 1fr; }

    .slj-aapm-thumbnails {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .slj-aapm-thumb {
        flex: 0 0 60px;
        width: 60px;
        height: 60px;
    }
}
