/* ================================================================
   DS Urban Nest – Services Widget v5
   CSS Grid layout (no Bootstrap row/col — no 3rd card wrapping bug)
   Palace theme card styles: exact match
   FA icon fix: font-family override on icon box
================================================================ */

.dsun-svc-wrap {
    position: relative;
    padding: 100px 0;
    background: #fff;
}

/* ── HEADER ──────────────────────────────────────────────────────── */
.dsun-svc-header {
    margin-bottom: 50px;
}
/* Theme sec-title_title adds // via :before — no need to add it in text */
.dsun-svc-header .sec-title_title {
    padding-left: 25px;
}
.dsun-svc-header.centered .sec-title_title {
    padding-left: 0;
}
.dsun-svc-header.centered .sec-title_title:before {
    position: static;
    display: inline;
    margin-right: 6px;
}

/* ── CSS GRID — fixes the 2-card problem ─────────────────────────── */
.dsun-svc-grid {
    display: grid;
    gap: 30px;
    width: 100%;
}
.dsun-svc-cols-1 { grid-template-columns: 1fr; }
.dsun-svc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.dsun-svc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.dsun-svc-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── CARD OUTER ──────────────────────────────────────────────────── */
.dsun-svc-card {
    position: relative;
    min-width: 0; /* prevent overflow in grid */
}

/* ── CARD INNER — palace service-block_one-inner equivalent ─────── */
.dsun-svc-inner {
    position: relative;
    padding: 40px 30px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0px 0px 20px rgba(0,0,0,0.04);
    background: #fff;
    height: 100%;
    transition: background-color 500ms ease;
}

/* ── HOVER BG IMAGE — exact palace animation ─────────────────────── */
/* scale(0,1) → scale(1,1), transform-origin: right→left */
.dsun-svc-bg-img {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    -webkit-transform: scale(0, 1);
    -ms-transform: scale(0, 1);
    transform: scale(0, 1);
    -webkit-transform-origin: right center;
    -ms-transform-origin: right center;
    transform-origin: right center;
    transition: -webkit-transform 0.4s ease;
    transition: transform 0.4s ease;
    transition: transform 0.4s ease, -webkit-transform 0.4s ease;
    z-index: 0;
}
.dsun-svc-bg-img:before {
    position: absolute;
    content: '';
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    opacity: 0.80;
    background-color: var(--color-two, #17171a);
}
.dsun-svc-inner:hover .dsun-svc-bg-img {
    -webkit-transform: scale(1, 1);
    -ms-transform: scale(1, 1);
    transform: scale(1, 1);
    -webkit-transform-origin: left center;
    -ms-transform-origin: left center;
    transform-origin: left center;
}

/* ── ICON BOX ─────────────────────────────────────────────────────── */
.dsun-svc-icon-box {
    position: relative;
    z-index: 1;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0px 0px 30px rgba(0,0,0,0.05);
    /* Reset flaticon font-family — theme sets this and breaks FA */
    font-family: inherit !important;
    transition: all 500ms ease;
}
.dsun-svc-inner:hover .dsun-svc-icon-box {
    background-color: var(--main-color);
    transform: rotateY(180deg);
}

/* ── ICON INNER SPAN — FA specific font-family ───────────────────── */
.dsun-icon-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.dsun-icon-inner i {
    font-size: 34px;
    color: var(--main-color);
    line-height: 1;
    /* Override any inherited flaticon font-family */
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free', 'FontAwesome' !important;
    font-weight: 900 !important;
    font-style: normal !important;
    transition: color 500ms ease;
}
.dsun-icon-inner svg {
    width: 34px;
    height: 34px;
    color: var(--main-color);
    fill: currentColor;
    transition: color 500ms ease;
}
.dsun-svc-inner:hover .dsun-icon-inner i,
.dsun-svc-inner:hover .dsun-icon-inner svg {
    color: #fff;
}

/* ── HEADING ──────────────────────────────────────────────────────── */
.dsun-svc-heading {
    position: relative;
    z-index: 1;
    margin-top: 25px;
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 700;
    transition: color 500ms ease;
}
.dsun-svc-heading a {
    color: var(--color-two);
    text-decoration: none;
    transition: color 500ms ease;
}
.dsun-svc-inner:hover .dsun-svc-heading a {
    color: #fff;
}

/* ── TEXT ─────────────────────────────────────────────────────────── */
.dsun-svc-text {
    position: relative;
    z-index: 1;
}
.dsun-svc-text p {
    position: relative;
    font-size: 16px;
    line-height: 28px;
    opacity: 0.75;
    margin-top: 15px;
    color: var(--color-two);
    transition: color 500ms ease;
}
.dsun-svc-inner:hover .dsun-svc-text p {
    color: #fff;
    opacity: 1;
}

/* ── READ MORE ────────────────────────────────────────────────────── */
.dsun-svc-more {
    position: relative;
    z-index: 1;
    font-size: 16px;
    font-weight: 600;
    margin-top: 25px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-two);
    text-decoration: none;
    border-bottom: 1px solid var(--main-color);
    transition: color 500ms ease;
}
.dsun-svc-more i {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free', 'FontAwesome' !important;
    font-weight: 900 !important;
    font-size: 12px;
}
.dsun-svc-inner:hover .dsun-svc-more {
    color: #fff;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .dsun-svc-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .dsun-svc-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .dsun-svc-wrap   { padding: 60px 0; }
    .dsun-svc-cols-4,
    .dsun-svc-cols-3,
    .dsun-svc-cols-2 { grid-template-columns: 1fr; }
    .dsun-svc-inner  { padding: 32px 24px; }
}
