/*
=====================================================================
AMIABLE IMPEX — HOMEPAGE "OUR MANUFACTURING OFFERINGS"
Dark textured canvas; split heading; 7 product cards + catalogue
tile in a 4-column grid. Logo palette: red / lime / black.
Markup: resources/views/home.php (section.of)
=====================================================================
*/

.of { isolation: isolate; overflow: hidden; }

/* Texture: fine grid + red & green light */
.of-texture { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.of-texture::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(243, 238, 230, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 238, 230, .045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 80%);
            mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 80%);
}
.of-texture::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(620px 380px at 92% 8%, rgba(229, 52, 59, .16), transparent 70%),
        radial-gradient(520px 360px at 4% 96%, rgba(166, 207, 63, .08), transparent 70%);
}

/* ---------- Heading: title left, intro right ---------- */
.of-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "kicker kicker" "title copy";
    align-items: end;
    column-gap: 64px;
    row-gap: 18px;
    margin-bottom: 56px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--nx-line-d);
}
.of-head .nx-kicker { grid-area: kicker; }
.of-head .nx-h2 { grid-area: title; color: #f6f2eb; }
.of-head p { grid-area: copy; max-width: 520px; justify-self: end; margin: 0 !important; font-size: 15px; line-height: 1.75; }

/* ---------- Grid ---------- */
.of-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.of-grid .nx-offer-list { display: contents; list-style: none; margin: 0; padding: 0; }

/* ---------- Product card ---------- */
.nx-offer {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 300px;
    padding: 26px 24px 24px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
    border: 1px solid var(--nx-line-d);
    border-radius: 20px;
    transition: transform .5s var(--nx-ease), border-color .5s var(--nx-ease), background .5s var(--nx-ease), box-shadow .5s var(--nx-ease);
}
.nx-offer::before { /* red seam on top */
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: var(--nx-copper-grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .7s var(--nx-ease);
}
.nx-offer:hover {
    transform: translateY(-4px);
    border-color: rgba(229, 52, 59, .45);
    background: linear-gradient(180deg, rgba(229, 52, 59, .09), rgba(255, 255, 255, .02));
    box-shadow: 0 34px 60px -40px rgba(0, 0, 0, .9);
}
.nx-offer:hover::before { transform: scaleX(1); }

.nx-offer-num {
    display: inline-grid;
    place-items: center;
    width: 46px; height: 46px;
    font: 500 13px/1 var(--nx-mono);
    letter-spacing: .04em;
    color: var(--nx-copper-2);
    background: rgba(166, 207, 63, .07);
    border: 1px solid rgba(166, 207, 63, .3);
    border-radius: 12px;
    transition: background .5s var(--nx-ease), color .5s var(--nx-ease), border-color .5s var(--nx-ease);
}
.nx-offer:hover .nx-offer-num { color: #fff; background: var(--nx-copper); border-color: var(--nx-copper); }

.nx-offer > div { display: flex; flex-direction: column; flex: 1; }

html body.nx-ui main .nx-offer h3 {
    --h-ff: var(--nx-serif);
    --h-fs: 17.5px;
    --h-lh: 1.38;
    --h-fw: 500;
    margin: 0;
    color: #f6f2eb !important;
}

/* Location with pin icon */
.nx-offer-loc {
    position: relative;
    margin: 14px 0 0 !important;
    padding-left: 22px;
    font: 400 13px/1.6 var(--nx-sans) !important;
    color: var(--nx-muted-d) !important;
}
.nx-offer-loc::before {
    content: "";
    position: absolute;
    left: 0; top: 3px;
    width: 14px; height: 14px;
    background: var(--nx-copper-2);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.1-7-11.5A7 7 0 0 1 19 9.5C19 14.9 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.1-7-11.5A7 7 0 0 1 19 9.5C19 14.9 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Standard / certification, pinned to the card bottom */
.nx-offer-std {
    position: relative;
    margin: auto 0 0 !important;
    padding: 14px 0 0 24px;
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: #f6f2eb !important;
    border-top: 1px dashed rgba(243, 238, 230, .14);
}
.nx-offer-std::before {
    content: "";
    position: absolute;
    left: 0; top: 16px;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: var(--nx-copper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0c0f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- Catalogue tile (8th cell) ---------- */
.of .nx-catalogue-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    min-height: 300px;
    padding: 26px 24px;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: var(--nx-copper-grad);
    border-radius: 20px;
    box-shadow: 0 30px 60px -36px rgba(229, 52, 59, .9);
    transition: transform .5s var(--nx-ease), box-shadow .5s var(--nx-ease);
}
.of .nx-catalogue-card::after { /* subtle diagonal texture on the red tile */
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 10px);
    pointer-events: none;
}
.of .nx-catalogue-card:hover { transform: translateY(-4px); box-shadow: 0 40px 70px -34px rgba(229, 52, 59, 1); }
.of .nx-catalogue-card:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.of .nx-catalogue-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 56px; height: 56px;
    font-size: 22px;
    color: var(--nx-copper-2);
    background: var(--nx-ink);
    border-radius: 16px;
}
.of .nx-catalogue-card strong { position: relative; z-index: 1; font: 400 28px/1.1 var(--nx-serif); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .of-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .of .nx-catalogue-card { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; }
}
@media (max-width: 900px) {
    .of-head { grid-template-columns: 1fr; grid-template-areas: "kicker" "title" "copy"; }
    .of-head p { justify-self: start; }
    .of-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .of .nx-catalogue-card { grid-column: auto; flex-direction: column; align-items: flex-start; justify-content: space-between; min-height: 260px; }
    .nx-offer { min-height: 260px; }
}
@media (max-width: 600px) {
    .of-head { margin-bottom: 40px; padding-bottom: 28px; }
    .of-grid { grid-template-columns: 1fr; gap: 12px; }
    .nx-offer, .of .nx-catalogue-card { min-height: 0; }
    .of .nx-catalogue-card { flex-direction: row; align-items: center; justify-content: flex-start; }
    .of .nx-catalogue-card strong { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .nx-offer, .nx-offer::before, .of .nx-catalogue-card { transition: none !important; }
}
