:root {
    --cd-bg: #f4f5f8;
    --cd-surface: #ffffff;
    --cd-text: #111827;
    --cd-muted: #6b7280;
    --cd-border: #e8eaef;
    --cd-radius: 14px;
    --cd-radius-sm: 10px;
    --cd-shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
    --cd-shadow-hover: 0 8px 28px rgba(17, 24, 39, 0.1);
    --cd-accent: #2563eb;
    --cd-shell-max: 1440px;
    --cd-shell-pad: clamp(12px, 2vw, 28px);
    --cd-sidebar: clamp(260px, 18vw, 310px);
    --cd-hero-h-max: 340px;
    --cd-hero-content-max: 36rem;
    --cd-hero-logo-max: 56px;
}

* { box-sizing: border-box; }

body.cd-public {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--cd-text);
    background: var(--cd-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* —— Shell: wide catalog surface —— */
.cd-shell {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
    width: min(96vw, var(--cd-shell-max));
    max-width: var(--cd-shell-max);
    margin: 0 auto;
    padding: var(--cd-shell-pad);
}

.cd-main {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
}

/* —— Header —— */
.cd-header {
    background: var(--cd-surface);
    border-radius: var(--cd-radius);
    box-shadow: var(--cd-shadow);
    padding: clamp(16px, 2vw, 22px) clamp(18px, 2.5vw, 28px);
}

.cd-header__inner {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cd-header__whatsapp {
    flex-shrink: 0;
    align-self: center;
}

.cd-header__link-btn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--cd-accent);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cd-header__link-btn:hover {
    opacity: 0.85;
}

.cd-header__brand {
    display: flex;
    gap: clamp(14px, 2vw, 20px);
    align-items: center;
}

.cd-header__logo {
    width: clamp(52px, 6vw, 72px);
    height: clamp(52px, 6vw, 72px);
    border-radius: 14px;
    object-fit: cover;
    background: #eef2ff;
    flex-shrink: 0;
}

.cd-header__logo--placeholder {
    display: block;
    background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
}

.cd-header__name {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.cd-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    color: var(--cd-muted);
    font-size: 0.9rem;
}

.cd-header__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
}

.cd-header__meta-item:empty {
    display: none;
}

.cd-header__meta-icon {
    color: var(--cd-accent);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.cd-header__meta-item--reviews .cd-header__meta-icon {
    color: #f5b301;
}

.cd-header__meta-text {
    line-height: 1.35;
}

/* —— Hero banner (referencia: identidad arriba + marketing abajo, bloque compacto izq.) —— */
.cd-hero {
    position: relative;
    border-radius: var(--cd-radius);
    overflow: hidden;
    box-shadow: var(--cd-shadow);
    height: clamp(240px, min(20vw, 30vh), var(--cd-hero-h-max));
    max-height: var(--cd-hero-h-max);
    background: linear-gradient(135deg, #1e293b, #334155);
}

.cd-hero__media {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e293b, #334155);
}

.cd-hero__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.cd-hero--no-image {
    height: clamp(220px, min(20vh, 28vw), 300px);
    max-height: 300px;
}

.cd-hero--no-image .cd-hero__overlay {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.cd-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    padding: clamp(18px, 2.2vw, 28px) clamp(18px, 2.5vw, 32px);
    /* Oscurece izquierda + bordes verticales para legibilidad sin tapar la foto */
    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.62) 0%,
            rgba(0, 0, 0, 0.38) 42%,
            rgba(0, 0, 0, 0.12) 72%,
            rgba(0, 0, 0, 0.05) 100%
        ),
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(0, 0, 0, 0.06) 45%,
            rgba(0, 0, 0, 0.22) 100%
        );
    color: #fff;
    pointer-events: none;
}

/* Bloque único compacto: brand → gap fijo → marketing (sin 1fr que estira el hueco) */
.cd-hero__inner {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    align-self: flex-start;
    width: 100%;
    max-width: min(var(--cd-hero-content-max), 100%);
    flex: 0 1 auto;
    min-height: 0;
    gap: clamp(16px, 2vw, 24px);
}

.cd-hero__overlay--with-content {
    justify-content: flex-start;
}

.cd-hero__brand {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
    pointer-events: none;
}

.cd-hero__marketing {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    min-width: 0;
    pointer-events: none;
}

.cd-hero__brand .cd-header__brand,
.cd-hero__marketing .cd-btn {
    pointer-events: auto;
}

/* Brand row: [LOGO] [NOMBRE + UBICACIÓN] */
.cd-header__brand--hero {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    gap: clamp(10px, 1.5vw, 14px);
}

.cd-header__brand--hero .cd-header__logo {
    width: clamp(44px, 4vw, var(--cd-hero-logo-max));
    height: clamp(44px, 4vw, var(--cd-hero-logo-max));
    max-width: var(--cd-hero-logo-max);
    max-height: var(--cd-hero-logo-max);
    object-fit: contain;
    object-position: center;
}

.cd-header__brand--hero .cd-header__name {
    color: #fff;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    max-width: 28ch;
    margin: 0 0 4px;
}

.cd-header__brand--hero .cd-header__meta {
    justify-content: flex-start;
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.78rem, 1.1vw, 0.88rem);
    max-width: 36ch;
}

.cd-header__brand--hero .cd-header__meta-text {
    overflow-wrap: anywhere;
}

.cd-header__brand--hero .cd-header__meta-icon {
    color: rgba(255, 255, 255, 0.95);
}

.cd-header__brand--hero .cd-header__meta-item--reviews .cd-header__meta-icon {
    color: #f5d76e;
}

.cd-header__brand--hero .cd-header__link-btn {
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.cd-header__brand--hero .cd-header__logo,
.cd-header__brand--hero .cd-header__logo--placeholder {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.cd-hero__overlay .cd-btn {
    pointer-events: auto;
    align-self: flex-start;
    margin-top: 8px;
}

.cd-hero__kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(0.65rem, 1vw, 0.75rem);
    opacity: 0.9;
    margin: 0 0 6px;
    max-width: min(36ch, 100%);
}

.cd-hero__title {
    margin: 0 0 8px;
    font-size: clamp(1.3rem, 2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.15;
    white-space: pre-line;
    max-width: min(38ch, 100%);
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}

.cd-hero__description {
    max-width: min(34rem, 100%);
    margin: 0;
    opacity: 0.94;
    font-size: clamp(0.84rem, 1.1vw, 0.95rem);
    white-space: pre-line;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* —— Layout grid —— */
.cd-layout {
    display: grid;
    grid-template-columns: minmax(260px, var(--cd-sidebar)) minmax(0, 1fr);
    gap: clamp(16px, 2vw, 24px);
    align-items: start;
}

.cd-layout--full {
    grid-template-columns: 1fr;
}

.cd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    align-self: stretch;
}

@media (min-width: 1024px) {
    .cd-sidebar__sticky {
        position: sticky;
        top: clamp(16px, 2vw, 24px);
        display: flex;
        flex-direction: column;
        gap: 14px;
        width: 100%;
    }
}

/* —— Sidebar blocks —— */
.cd-feature-blocks {
    background: var(--cd-surface);
    border-radius: var(--cd-radius);
    border: 1px solid var(--cd-border);
    padding: 4px 0;
    overflow: hidden;
}

.cd-feature-block {
    display: flex;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cd-border);
    transition: background 0.15s ease;
}

.cd-feature-block:last-child {
    border-bottom: 0;
}

.cd-feature-block:hover {
    background: #fafbfc;
}

.cd-feature-block__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--cd-accent) 12%, transparent);
    color: var(--cd-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

.cd-feature-block__title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.cd-feature-block__text {
    margin: 0;
    color: var(--cd-muted);
    font-size: 0.86rem;
    line-height: 1.4;
    white-space: pre-line;
}

.cd-promo {
    background: var(--cd-surface);
    border-radius: var(--cd-radius);
    border: 1px solid var(--cd-border);
    padding: 18px;
}

.cd-promo__image {
    width: 100%;
    border-radius: var(--cd-radius-sm);
    margin-bottom: 12px;
    display: block;
}

.cd-promo__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
}

.cd-promo__text {
    color: var(--cd-muted);
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-line;
}

/* —— Catalog toolbar —— */
.cd-catalog {
    min-width: 0;
}

.cd-toolbar {
    margin-bottom: 18px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--cd-border);
}

.cd-toolbar__row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(10px, 1.5vw, 16px);
    margin-bottom: 10px;
    width: 100%;
}

.cd-toolbar__row--contact {
    margin-bottom: 8px;
}

.cd-toolbar__row--filters {
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: clamp(10px, 1.5vw, 16px);
    margin-bottom: 10px;
}

.cd-toolbar__contact {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(6px, 1vw, 12px);
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
}

.cd-toolbar__contact::-webkit-scrollbar {
    display: none;
}

.cd-toolbar__contact .cd-header__meta-item {
    flex-shrink: 0;
    white-space: nowrap;
}

.cd-toolbar__hours,
.cd-toolbar__reviews {
    color: var(--cd-muted);
    font-size: clamp(0.78rem, 1.6vw, 0.88rem);
}

.cd-toolbar__meta {
    display: inline-flex;
    align-items: center;
    gap: clamp(8px, 1.2vw, 14px);
    flex: 1 1 auto;
    min-width: 0;
    margin-right: auto;
}

.cd-toolbar__meta-sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: var(--cd-border);
    flex-shrink: 0;
}

.cd-toolbar__reviews {
    margin-right: 0;
}

.cd-toolbar__reviews .cd-header__meta-icon {
    color: #f5b301;
}

.cd-toolbar__whatsapp {
    flex-shrink: 0;
    min-height: 38px;
    padding: 8px 14px;
    font-size: clamp(0.78rem, 1.6vw, 0.86rem);
    white-space: nowrap;
}

.cd-search {
    position: relative;
    flex: 1 1 360px;
    min-width: min(100%, 240px);
    max-width: 480px;
    width: auto;
    margin: 0;
}

.cd-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.cd-search__field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.cd-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cd-muted);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.cd-search input {
    width: 100%;
    border: 1px solid var(--cd-border);
    border-radius: 12px;
    padding: 12px 16px 12px 44px;
    min-height: 48px;
    font-size: 1rem;
    background: var(--cd-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cd-search input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--cd-accent) 50%, var(--cd-border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cd-accent) 15%, transparent);
}

.cd-search__field:focus-within .cd-search__icon {
    color: var(--cd-accent);
}

.cd-chips {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: center;
}

.cd-chips::-webkit-scrollbar {
    display: none;
}

.cd-chip {
    border: 1px solid var(--cd-border);
    background: var(--cd-surface);
    color: var(--cd-text);
    border-radius: 999px;
    padding: 7px 14px;
    min-height: 36px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.cd-chip:hover {
    border-color: color-mix(in srgb, var(--cd-accent) 40%, var(--cd-border));
}

.cd-chip.is-active {
    background: var(--cd-accent);
    border-color: var(--cd-accent);
    color: #fff;
}

.cd-chip:focus-visible {
    outline: 2px solid var(--cd-accent);
    outline-offset: 2px;
}

/* —— Sections & grids —— */
.cd-section {
    margin-bottom: 28px;
}

.cd-section__title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cd-grid {
    display: grid;
    gap: 14px;
}

.cd-grid--products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cd-grid--services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* —— Cards —— */
.cd-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cd-border);
    border-radius: var(--cd-radius-sm);
    overflow: hidden;
    background: var(--cd-surface);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    height: 100%;
}

.cd-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--cd-shadow-hover);
    border-color: #d8dce3;
}

.cd-card__media-link {
    display: block;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
}

.cd-card__media {
    position: relative;
    background: #f3f4f6;
    overflow: hidden;
}

.cd-card--product .cd-card__media {
    aspect-ratio: 1 / 1;
}

.cd-card--service .cd-card__media {
    aspect-ratio: 4 / 3;
}

.cd-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cd-card--service .cd-card__media img {
    object-fit: cover;
    object-position: center;
}

.cd-card__placeholder,
.cd-item-gallery__placeholder {
    width: 100%;
    height: 100%;
    min-height: 80px;
    background: linear-gradient(135deg, #e5e7eb, #f9fafb);
}

.cd-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0;
}

.cd-card__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.cd-card__title {
    margin: 4px 0 6px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cd-card__text {
    margin: 0 0 8px;
    color: var(--cd-muted);
    font-size: 0.82rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cd-card__footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
}

.cd-card__meta {
    margin: 0;
    color: var(--cd-muted);
    font-size: 0.78rem;
}

.cd-card__price {
    margin: 0;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--cd-accent);
}

.cd-card--product .cd-card__price {
    margin-top: auto;
    padding-top: 4px;
}

/* CTA integrado al final del body (precio → botones compactos tipo referencia) */
.cd-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 0;
    flex-shrink: 0;
}

.cd-card__actions .cd-btn--card-cta {
    flex: 1 1 calc(50% - 3px);
    max-width: calc(50% - 3px);
    width: auto;
    min-width: 0;
    min-height: 28px;
    padding: 5px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 6px;
    gap: 4px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.cd-card__actions .cd-btn--card-cta .fa {
    font-size: 0.95em;
    flex-shrink: 0;
}

.cd-card__actions .cd-btn--whatsapp.cd-btn--card-cta {
    background: #fff;
    color: #16a34a;
    border-color: #16a34a;
}

.cd-card__actions .cd-btn--whatsapp.cd-btn--card-cta:hover {
    background: #f0fdf4;
    opacity: 1;
}

.cd-card__actions .cd-btn--reserve.cd-btn--card-cta {
    background: #fff;
    color: var(--cd-accent);
    border-color: var(--cd-accent);
}

.cd-card__actions .cd-btn--reserve.cd-btn--card-cta:hover {
    background: var(--cd-accent-soft, #eff6ff);
    opacity: 1;
}

.cd-btn--compact {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.8rem;
}

.cd-btn--whatsapp {
    background: #16a34a;
    color: #fff;
    gap: 6px;
}

.cd-btn--whatsapp:hover {
    opacity: 0.92;
}

.cd-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.cd-card__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.cd-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(245, 179, 1, 0.16);
    color: #9a6700;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.cd-featured-badge .fa {
    font-size: 0.62rem;
}

.cd-item-featured {
    margin: 0 0 8px;
}

.cd-toggle-featured {
    padding: 2px 6px;
    font-size: 1.15rem;
    line-height: 1;
    color: #9ca3af;
}

.cd-toggle-featured.is-featured {
    color: #f5b301;
}

.cd-type-badge {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 600;
}

.cd-type-badge--service {
    background: #ecfeff;
    color: #0e7490;
}

.cd-photo-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(17, 24, 39, 0.78);
    color: #fff;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 0.7rem;
}

/* —— Buttons —— */
.cd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 18px;
    min-height: 42px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.cd-btn:hover {
    opacity: 0.92;
}

.cd-btn:focus-visible {
    outline: 2px solid var(--cd-accent);
    outline-offset: 2px;
}

.cd-btn--primary {
    background: var(--cd-accent);
    color: var(--cd-accent-fg, #fff);
}

.cd-btn--secondary {
    background: #111827;
    color: #fff;
}

.cd-btn--ghost {
    background: var(--cd-surface);
    border: 1px solid var(--cd-border);
    color: var(--cd-text);
    min-width: 160px;
}

.cd-btn--ghost:hover {
    border-color: #c5cad3;
    background: #fafbfc;
}

.cd-load-more-wrap {
    text-align: center;
    margin-top: 16px;
    padding-top: 4px;
}

.cd-empty {
    color: var(--cd-muted);
    text-align: center;
    padding: 40px 16px;
    background: var(--cd-surface);
    border-radius: var(--cd-radius);
    border: 1px dashed var(--cd-border);
}

/* —— Item detail —— */
.cd-back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--cd-accent);
    text-decoration: none;
    font-weight: 500;
}

.cd-item-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: var(--cd-surface);
    border-radius: var(--cd-radius);
    box-shadow: var(--cd-shadow);
    padding: 24px;
}

.cd-item-gallery {
    overflow: hidden;
    border-radius: 12px;
    background: #f3f4f6;
}

.cd-item-gallery--product {
    aspect-ratio: 1 / 1;
}

.cd-item-gallery--service {
    aspect-ratio: 4 / 3;
}

.cd-item-gallery__main {
    border: 0;
    padding: 0;
    background: none;
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    position: relative;
}

.cd-item-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cd-item-title {
    margin: 8px 0;
    font-size: 1.8rem;
}

.cd-item-description {
    color: var(--cd-text);
    white-space: pre-line;
}

.cd-item-price {
    margin: 8px 0 0;
    font-weight: 700;
    color: var(--cd-accent);
}

/* —— Lightbox —— */
.cd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cd-lightbox[hidden] {
    display: none !important;
}

.cd-lightbox.is-loading .cd-lightbox__stage {
    opacity: 0.35;
}

.cd-lightbox.is-loading .cd-lightbox__image {
    visibility: hidden;
}

.cd-lightbox__stage {
    position: relative;
    max-width: min(92vw, 960px);
    width: 100%;
    max-height: calc(100dvh - 140px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cd-lightbox__image {
    width: auto;
    max-width: 100%;
    max-height: min(70dvh, calc(100dvh - 160px));
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.cd-lightbox__counter {
    text-align: center;
    color: #fff;
    margin-top: 8px;
}

.cd-lightbox__close,
.cd-lightbox__nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
}

.cd-lightbox__close {
    top: 16px;
    right: 16px;
}

.cd-lightbox__prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.cd-lightbox__next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.cd-lightbox__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    max-width: 100%;
}

.cd-lightbox__thumbs img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    opacity: 0.7;
    cursor: pointer;
}

.cd-lightbox__thumbs img.is-active {
    opacity: 1;
    outline: 2px solid #fff;
}

/* —— Breakpoints —— */

/* Desktop amplio */
@media (min-width: 1440px) {
    .cd-grid--products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cd-grid--services {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Desktop grande: más espacio, no elementos gigantes */
@media (min-width: 1600px) {
    .cd-hero {
        height: var(--cd-hero-h-max);
    }

    .cd-hero--no-image {
        height: 300px;
    }
}

/* Desktop / tablet landscape */
@media (max-width: 1439px) and (min-width: 1024px) {
    .cd-grid--products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cd-grid--services {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet */
@media (max-width: 1023px) {
    .cd-toolbar__contact .cd-header__link-btn {
        font-size: 0.8rem;
    }

    .cd-layout {
        grid-template-columns: 1fr;
    }

    .cd-sidebar {
        order: 2;
    }

    .cd-feature-blocks {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 0;
    }

    .cd-feature-block {
        border-bottom: 0;
        border-right: 1px solid var(--cd-border);
        border-bottom: 1px solid var(--cd-border);
        padding: 12px 14px;
    }

    .cd-feature-block:nth-child(2n) {
        border-right: 0;
    }

    .cd-grid--products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .cd-grid--services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cd-item-card {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 599px) {
    .cd-shell {
        width: 100%;
        padding: 10px;
    }

    .cd-header {
        padding: 14px 16px;
    }

    .cd-header__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Hero: banner compacto, texto superpuesto dentro de la imagen */
    .cd-hero {
        height: clamp(210px, 48vw, 260px);
        max-height: 260px;
    }

    .cd-hero--no-image {
        height: clamp(200px, 44vw, 240px);
        max-height: 240px;
    }

    .cd-hero__overlay {
        padding: 14px 16px 14px;
        background:
            linear-gradient(
                90deg,
                rgba(0, 0, 0, 0.7) 0%,
                rgba(0, 0, 0, 0.4) 55%,
                rgba(0, 0, 0, 0.15) 100%
            ),
            linear-gradient(
                180deg,
                rgba(0, 0, 0, 0.25) 0%,
                rgba(0, 0, 0, 0.08) 50%,
                rgba(0, 0, 0, 0.3) 100%
            );
    }

    .cd-hero__inner {
        gap: 12px;
    }

    .cd-header__brand--hero .cd-header__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .cd-header__brand--hero .cd-header__logo {
        width: clamp(40px, 10vw, 52px);
        height: clamp(40px, 10vw, 52px);
    }

    .cd-hero__title {
        font-size: clamp(1.2rem, 5.2vw, 1.55rem);
        max-width: 100%;
        margin-bottom: 6px;
    }

    .cd-hero__description {
        font-size: 0.8rem;
        margin-bottom: 0;
        -webkit-line-clamp: 2;
    }

    .cd-hero__kicker {
        margin-bottom: 4px;
    }

    .cd-feature-blocks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cd-feature-block__icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .cd-grid--products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .cd-grid--services {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Service: imagen ~25% más baja en móvil (4:3 → 16:9) */
    .cd-card--service .cd-card__media {
        aspect-ratio: 16 / 9;
    }

    .cd-card--service {
        border-radius: 12px;
    }

    .cd-card--service .cd-card__body {
        padding: 10px 12px 12px;
        gap: 6px;
    }

    .cd-card--service .cd-type-badge {
        display: none;
    }

    .cd-card--service .cd-card__title {
        font-size: 0.88rem;
        margin-top: 0;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
    }

    .cd-card--service .cd-card__text {
        -webkit-line-clamp: 1;
        font-size: 0.75rem;
        margin-bottom: 4px;
    }

    .cd-item-card {
        padding: 16px;
        gap: 16px;
    }

    .cd-item-gallery--service,
    .cd-item-gallery--product {
        aspect-ratio: auto;
        width: 100%;
        height: 300px;
        max-height: 300px;
    }

    .cd-item-gallery__main {
        height: 300px;
        max-height: 300px;
    }

    .cd-item-gallery__main img {
        width: 100%;
        height: 300px;
        max-height: 300px;
        object-fit: cover;
        object-position: center;
    }

    .cd-lightbox {
        padding: 12px;
        padding-top: max(12px, env(safe-area-inset-top, 0px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .cd-lightbox__stage {
        max-width: 100%;
        max-height: calc(100dvh - 128px);
    }

    .cd-lightbox__image {
        max-height: min(52dvh, calc(100dvh - 148px));
    }

    .cd-lightbox__close {
        top: max(12px, env(safe-area-inset-top, 0px));
        right: 12px;
    }

    .cd-lightbox__prev {
        left: 8px;
    }

    .cd-lightbox__next {
        right: 8px;
    }

    .cd-card--service .cd-card__footer {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 8px;
        margin-top: 0;
    }

    .cd-card--service .cd-card__actions {
        margin-top: 4px;
        gap: 5px;
    }

    .cd-card--service .cd-btn--card-cta {
        min-height: 26px;
        padding: 4px 7px;
        font-size: 0.68rem;
    }

    .cd-card--product .cd-card__body {
        padding: 8px 10px 10px;
        gap: 8px;
    }

    .cd-card--product .cd-card__title {
        font-size: 0.84rem;
    }

    .cd-card--product .cd-card__text {
        -webkit-line-clamp: 1;
        font-size: 0.75rem;
    }

    .cd-card--product .cd-card__price {
        font-size: 0.85rem;
    }

    .cd-card--product .cd-card__actions {
        margin-top: 4px;
        gap: 5px;
    }

    .cd-card--product .cd-btn--card-cta {
        min-height: 26px;
        padding: 4px 6px;
        font-size: 0.66rem;
        gap: 3px;
    }

    .cd-chip {
        padding: 8px 14px;
        font-size: 0.84rem;
    }

    .cd-header__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .cd-header__whatsapp {
        align-self: stretch;
        justify-content: center;
    }

    .cd-toolbar__row {
        gap: 8px;
    }

    .cd-toolbar__row--filters {
        flex-wrap: wrap;
    }

    .cd-toolbar__contact {
        justify-content: flex-end;
        width: 100%;
    }

    .cd-search {
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
    }

    .cd-chips {
        flex: 1 1 100%;
    }

    .cd-toolbar__whatsapp {
        min-height: 34px;
        padding: 6px 12px;
    }
}

/* —— Integrations: modals —— */
.cd-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cd-modal[hidden] {
    display: none !important;
}

.cd-modal__panel {
    width: min(100%, 520px);
    max-height: min(85vh, 640px);
    background: var(--cd-surface);
    border-radius: var(--cd-radius);
    box-shadow: var(--cd-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cd-modal__panel--compact {
    width: min(100%, 400px);
}

.cd-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--cd-border);
}

.cd-modal__title {
    margin: 0;
    font-size: 1.05rem;
}

.cd-modal__close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--cd-muted);
    width: 36px;
    height: 36px;
}

.cd-modal__body {
    padding: 16px 18px;
    overflow-y: auto;
}

.cd-modal__footer {
    padding-top: 12px;
    text-align: center;
}

.cd-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cd-review-item {
    border: 1px solid var(--cd-border);
    border-radius: var(--cd-radius-sm);
    padding: 12px 14px;
}

.cd-review-item__stars {
    color: #f59e0b;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.cd-review-item__meta {
    font-size: 0.78rem;
    color: var(--cd-muted);
    margin-bottom: 6px;
}

.cd-review-item__comment {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-line;
}

.cd-review-item__photo-btn {
    display: block;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    max-width: 160px;
}

.cd-review-item__photo-btn:focus-visible {
    outline: 2px solid var(--cd-accent);
    outline-offset: 2px;
}

.cd-review-item__photo {
    display: block;
    width: 100%;
    max-width: 160px;
    max-height: 160px;
    object-fit: cover;
    border-radius: 10px;
}

.cd-hours-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-hours-list__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cd-border);
    font-size: 0.92rem;
}

.cd-hours-list__row:last-child {
    border-bottom: 0;
}

.cd-hours-list__row.is-closed .cd-hours-list__time {
    color: var(--cd-muted);
}

.cd-alert {
    border-radius: var(--cd-radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.cd-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.cd-header__name,
.cd-card__title,
.cd-item__title,
.cd-hero__title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cd-lightbox__thumb {
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
}

.cd-lightbox__thumb.is-active {
    outline: 2px solid var(--cd-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cd-btn,
    .cd-card,
    .cd-lightbox,
    .cd-modal,
    .cd-hero__image img {
        transition: none !important;
    }
}

@media (max-width: 360px) {
    .cd-header__meta {
        font-size: 0.82rem;
    }

    .cd-grid--products {
        gap: 8px;
    }
}
