/**
 * Cartadigital3 - Estilos Base
 * Incluye: Reset, Tipografía, Layout, Navegación, Componentes, Layouts específicos
 * Version: 2.0 - Footer actualizado
 */

/* ========================================
   RESET Y BASE
   ======================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
}

/* ========================================
   TIPOGRAFÍA
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
}

/* ========================================
   LAYOUT - CONTENEDOR
   ======================================== */

.cd-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cd-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.cd-container--narrow {
    max-width: 800px;
}

.cd-main {
    flex: 1;
    padding-top: 20px;
}

/* ========================================
   HEADER
   ======================================== */

.cd-header {
    background-color: #ffffff;
    color: #333;
    padding: 16px 0;
    z-index: 1000;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.cd-header--fixed {
    position: sticky;
    top: 0;
}

.cd-header--fixed.is-scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
    padding: 12px 0;
}

.cd-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-unit);
}

.cd-header__logo {
    flex-shrink: 0;
    margin-left: 0;
    max-width: 65%;
}

.cd-header__logo img {
    max-height: 120px;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: max-height 0.3s ease;
}

.cd-header--fixed.is-scrolled .cd-header__logo img {
    max-height: 100px;
}

@media (min-width: 768px) {
    .cd-header__logo img {
        max-height: 150px;
    }

    .cd-header--fixed.is-scrolled .cd-header__logo img {
        max-height: 120px;
    }
}

/* ========================================
   NAVEGACIÓN
   ======================================== */

.cd-nav {
    position: static;
    display: flex;
    align-items: center;
}

/* Toggle móvil */
.cd-nav__toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cd-nav__toggle:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.05);
}

.cd-nav__toggle:active {
    transform: scale(0.95);
}

.cd-nav__toggle-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cd-nav__toggle.is-active .cd-nav__toggle-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.cd-nav__toggle.is-active .cd-nav__toggle-line:nth-child(2) {
    opacity: 0;
}

.cd-nav__toggle.is-active .cd-nav__toggle-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Menú - Full Width Dropdown */
.cd-nav__menu {
    position: absolute;
    top: calc(100% + 16px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: 0;
    background: var(--color-primary, #2c2c2c);
    overflow: hidden;
    transition: max-height 0.4s ease, box-shadow 0.3s ease, margin-top 0.4s ease;
    z-index: 999;
    box-shadow: 0 0 0 rgba(0,0,0,0);
    border-radius: 8px;
    margin-top: -10px;
}

.cd-nav__menu.is-open {
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    margin-top: 0;
}

.cd-nav__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    padding: 20px;
}

.cd-nav__item {
    position: relative;
}

.cd-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    color: var(--nav-text-color, #ffffff);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: left;
    cursor: pointer;
}

/* Estilo especial para categorías con subcategorías */
.cd-nav__link--dropdown {
    background: rgba(255,255,255,0.1);
    font-weight: 600;
    padding: 16px 18px;
    border: 1px solid rgba(255,255,255,0.15);
}

.cd-nav__link--dropdown:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.25);
    transform: scale(1.02);
}

.cd-nav__link:hover {
    background: rgba(255,255,255,0.15);
    color: var(--nav-text-color, #ffffff);
    transform: scale(1.02);
}

.cd-nav__link-text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cd-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nav-text-color, #ffffff);
    line-height: 1;
}

.cd-nav__arrow {
    transition: transform 0.3s ease;
    opacity: 0.8;
    margin-left: 8px;
    flex-shrink: 0;
}

.cd-nav__link--dropdown[aria-expanded="true"] {
    background: rgba(255,255,255,0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.cd-nav__link--dropdown[aria-expanded="true"] .cd-nav__arrow {
    transform: rotate(180deg);
}

.cd-nav__link--dropdown[aria-expanded="true"] .cd-nav__badge {
    background: rgba(255,255,255,0.35);
}

/* Submenús */
.cd-nav__submenu,
.cd-nav__subsubmenu {
    display: none;
    padding-left: 16px;
    margin-top: 4px;
}

.cd-nav__submenu.is-open,
.cd-nav__subsubmenu.is-open {
    display: block;
}

.cd-nav__sublink,
.cd-nav__subsublink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    color: var(--nav-text-color, rgba(255,255,255,0.9));
    font-size: 0.9375rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-align: left;
    cursor: pointer;
}

/* Estilo especial para subcategorías con hijos */
.cd-nav__sublink--dropdown {
    background: rgba(255,255,255,0.08);
    font-weight: 600;
    border-left: 3px solid rgba(255,255,255,0.3);
}

.cd-nav__sublink--dropdown:hover {
    background: rgba(255,255,255,0.15);
    border-left-color: rgba(255,255,255,0.5);
}

.cd-nav__sublink--dropdown[aria-expanded="true"] {
    background: rgba(255,255,255,0.12);
}

.cd-nav__sublink:hover,
.cd-nav__subsublink:hover {
    background: rgba(255,255,255,0.15);
    color: var(--nav-text-color, #ffffff);
    transform: scale(1.02);
}

/* Overlay ya no es necesario para menú dropdown vertical */

/* NOTA: Siempre usar diseño móvil con hamburguesa menu
   para mantener un diseño limpio y consistente en todas las pantallas */

/* ========================================
   CATEGORÍAS
   ======================================== */

.cd-category {
    padding: 40px 0 20px;
    text-align: center;
}

.cd-category--level1 {
    padding-top: 50px;
}

.cd-category--level2 {
    padding: 30px 0 15px;
}

.cd-category--level3 {
    padding: 20px 0 10px;
}

.cd-category__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cd-category__title {
    font-family: var(--font-title);
    font-size: 40px;
    color: var(--color-primary);
    font-weight: 400;
}

.cd-category__subtitle {
    font-family: var(--font-headings);
    font-size: 1.875rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
}

.cd-category__label {
    display: inline-block;
    font-family: var(--font-subheadings);
    font-size: 1rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.cd-category__divider {
    color: var(--color-primary);
}

.cd-category__divider svg {
    width: 24px;
    height: 24px;
}

/* Minimal category styles */
.cd-category--minimal .cd-category__title {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 8px;
}

/* ========================================
   ITEMS - LAYOUT CLÁSICO
   ======================================== */

.cd-menu-section {
    padding: 16px 0;
}

.cd-menu-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .cd-menu-row {
        grid-template-columns: 1fr 1fr;
        gap: 24px 40px;
    }
}

.cd-menu-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cd-item {
    padding: 16px;
    background: var(--color-background);
    border-radius: var(--border-radius);
    transition: box-shadow 0.2s ease;
}

.cd-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.cd-item--featured {
    border-left: 3px solid var(--color-accent);
}

.cd-item__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
}

.cd-item__name {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
}

.cd-item__badge {
    color: var(--color-accent);
    margin-left: 8px;
}

.cd-item__price {
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

.cd-item__desc {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.5;
}

.cd-item__discount {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--color-accent);
    font-weight: 500;
}

/* ========================================
   ITEMS - LAYOUT CARDS
   ======================================== */

.cd-cards-section {
    padding: 16px 0;
}

.cd-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.cd-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.cd-card--featured {
    border: 2px solid var(--color-accent);
}

.cd-card__image {
    aspect-ratio: 16/10;
    background: var(--color-secondary);
    overflow: hidden;
}

.cd-card__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    opacity: 0.4;
}

.cd-card__body {
    padding: 16px;
}

.cd-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.cd-card__name {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.cd-card__badge {
    color: var(--color-accent);
    font-size: 1rem;
}

.cd-card__desc {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0 0 12px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cd-card__footer {
    padding-top: 12px;
    border-top: 1px solid var(--color-secondary);
}

.cd-card__price {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ========================================
   ITEMS - LAYOUT MINIMAL
   ======================================== */

.cd-minimal-section {
    padding: 8px 0;
}

.cd-minimal-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.layout-minimal .cd-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-secondary);
    border-radius: 0;
    text-align: center;
}

.layout-minimal .cd-item:last-child {
    border-bottom: none;
}

.layout-minimal .cd-item:hover {
    box-shadow: none;
    background: var(--color-secondary);
}

.layout-minimal .cd-item__content {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.layout-minimal .cd-item__name {
    font-size: 1.125rem;
}

.layout-minimal .cd-item__desc {
    text-align: center;
    max-width: 500px;
}

/* ========================================
   ITEMS - LAYOUT GRID
   ======================================== */

.cd-grid-section {
    padding: 16px 0;
}

.cd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

@media (min-width: 768px) {
    .cd-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.cd-grid-item {
    position: relative;
}

.cd-grid-item__inner {
    background: var(--color-secondary);
    padding: 20px;
    border-radius: var(--border-radius);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease;
}

.cd-grid-item:hover .cd-grid-item__inner {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.cd-grid-item--featured .cd-grid-item__inner {
    background: #fff;
    border: 2px solid var(--color-accent);
}

.cd-grid-item__name {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.cd-grid-item__desc {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin: 0 0 12px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cd-grid-item__price {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.cd-grid-item__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--color-accent);
}

/* ========================================
   ESTADO VACÍO
   ======================================== */

.cd-empty {
    padding: 80px 0;
}

.cd-empty__content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.cd-empty__icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.cd-empty__title {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.cd-empty__text {
    color: var(--color-text-light);
}

/* ========================================
   FOOTER
   ======================================== */

.cd-footer {
    background-color: #1a1a1a;
    color: #999;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

.cd-footer .cd-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cd-footer__copyright {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cd-footer__text {
    font-size: 0.875rem;
    color: #999;
    margin: 0;
    margin-bottom: 0 !important;
    line-height: 1.6;
    display: inline;
}

.cd-footer__text a {
    color: #e74c3c;
    transition: color 0.2s ease;
    text-decoration: none;
}

.cd-footer__text a:hover {
    color: #fff;
}

/* .cd-footer__social {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
} */

.cd-footer__social {
    display: flex;         /* Activa el modo flexible */
    justify-content: center; /* Centra el contenido horizontalmente */
    width: 100%;           /* Obliga a que ocupe todo el ancho para bajar al siguiente renglón */
    margin-top: 5px !important
}

.cd-footer__social-link {
    color: #fff;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 3px; 
}

.cd-footer__social-link:hover {
    color: #e74c3c;
    transform: translateY(-2px);
}

.cd-footer__social-link svg {
    width: 16px;  
    height: 16px;
}

/* ========================================
   CUSTOM HTML SECTIONS
   ======================================== */

.cd-custom-header,
.cd-custom-footer {
    padding: var(--spacing-unit) 0;
}

/* ========================================
   WHATSAPP FLOTANTE
   ======================================== */

.cd-whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 999;
}

.cd-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
    color: #fff;
}

.cd-whatsapp-float svg {
    width: 32px;
    height: 32px;
}

/* ========================================
   SCROLL TOP BUTTON
   ======================================== */

.cd-scroll-top {
    position: fixed !important;
    bottom: 50px !important; 
    right: 48px !important;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    
    /* Cambiamos display:none por esto para que la animación funcione */
    display: flex; 
    align-items: center;
    justify-content: center;
    
    /* Estado inicial: Invisible y un poco abajo */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    
    transition: all 0.4s ease;
    z-index: 9999 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
    outline: none;
}

/* Clase que activa el JavaScript */
.cd-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cd-scroll-top:hover {
    transform: scale(1.1);
    background-color: var(--color-primary);
}

/* ========================================
   UTILIDADES
   ======================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Desktop grande (1400px+) */
@media (min-width: 1400px) {
    /* Navegación desktop - 5 columnas */
    .cd-nav__list {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Desktop (1024px - 1400px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    /* Navegación desktop - 4 columnas */
    .cd-nav__list {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablets y pantallas medianas (768px - 1024px) */
@media (max-width: 1024px) {
    .cd-container {
        padding: 0 20px;
    }

    .cd-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    /* Navegación tablet - 3 columnas */
    .cd-nav__list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Móviles grandes y tablets pequeñas (481px - 768px) */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    body {
        font-size: 16px;
    }

    .cd-container {
        padding: 0 16px;
    }

    .cd-main {
        padding-top: 16px;
    }

    /* Header móvil */
    .cd-header {
        padding: 12px 0;
    }

    .cd-header__logo img {
        max-height: 60px;
    }

    /* Categorías */
    .cd-category {
        padding: 24px 0 16px 0;
    }

    .cd-category__title {
        font-size: 1.75rem;
    }

    .cd-category__subtitle {
        font-size: 1.625rem;
    }

    /* Tarjetas - 2 columnas en tablet */
    .cd-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .cd-card__body {
        padding: 12px;
    }

    .cd-card__name {
        font-size: 0.95rem;
        font-weight: 700;
    }

    .cd-card__price {
        font-size: 1rem;
    }

    .cd-card__desc {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
    }

    /* Botones flotantes */
    .cd-whatsapp-float {
        width: 54px;
        height: 54px;
        bottom: 20px;
        right: 16px;
    }

    .cd-whatsapp-float svg {
        width: 28px;
        height: 28px;
    }

    .cd-scroll-top {
        bottom: 20px;
        right: 16px !important;
        left: auto !important;
        margin-left: 0 !important;
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    /* Navegación tablet - 2 columnas */
    .cd-nav__list {
        grid-template-columns: repeat(2, 1fr);
        padding: 18px;
        gap: 8px;
    }
}

/* Móviles (320px - 480px) */
@media (max-width: 480px) {
    html {
        font-size: 17px;
    }

    body {
        font-size: 18px;
    }

    .cd-container {
        padding: 0 12px;
    }

    .cd-main {
        padding-top: 12px;
    }

    /* Header móvil pequeño */
    .cd-header {
        padding: 12px 0;
    }

    .cd-header__logo {
        max-width: 60%;
        margin-left: 4px;
    }

    .cd-header__logo img {
        max-height: 50px;
    }

    .cd-header--fixed.is-scrolled .cd-header__logo img {
        max-height: 45px;
    }

    /* Navegación móvil - Full Width en una columna */
    .cd-nav__menu {
        left: 0;
        right: 0;
    }

    .cd-nav__list {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 6px;
    }

    .cd-nav__toggle {
        width: 40px;
        height: 40px;
    }

    .cd-nav__link {
        padding: 14px 16px;
        font-size: 1.0625rem;
    }

    .cd-nav__sublink {
        padding: 12px 14px;
        font-size: 1rem;
    }

    /* Categorías */
    .cd-category {
        padding: 24px 0 14px 0;
    }

    .cd-category__title {
        font-size: 2rem;
        margin-bottom: 10px;
        font-weight: 700;
    }

    .cd-category__subtitle {
        font-size: 1.625rem;
        font-weight: 700;
    }

    /* Tarjetas - 1 columna en móvil */
    .cd-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cd-cards-section {
        padding: 12px 0;
    }

    .cd-card {
        border-radius: 10px;
    }

    .cd-card__body {
        padding: 16px;
    }

    .cd-card__header {
        margin-bottom: 12px;
        gap: 10px;
    }

    .cd-card__name {
        font-size: 1.25rem;
        line-height: 1.3;
        font-weight: 700;
        padding-left: 48px;
    }

    .cd-card__price {
        font-size: 1.3125rem;
        font-weight: 700;
        padding-left: 48px;
        margin-top: 6px;
    }

    .cd-card__desc {
        font-size: 1rem;
        margin-bottom: 10px;
        line-height: 1.5;
        padding-left: 48px;
        margin-top: 8px;
    }

    .cd-card__badge {
        font-size: 1rem;
    }

    /* Grid layout */
    .cd-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cd-grid-item__inner {
        padding: 14px;
    }

    .cd-grid-item__name {
        font-size: 1rem;
    }

    .cd-grid-item__price {
        font-size: 1.0625rem;
    }

    /* Items clásicos */
    .cd-item {
        padding: 16px 0;
    }

    .cd-item__name {
        font-size: 1.0625rem;
    }

    .cd-item__price {
        font-size: 1.125rem;
    }

    .cd-item__desc {
        font-size: 0.9375rem;
    }

    /* Empty state */
    .cd-empty {
        padding: 40px 0;
    }

    .cd-empty__icon {
        font-size: 4rem;
    }

    .cd-empty__title {
        font-size: 1.375rem;
    }

    /* Footer */
    .cd-footer {
        padding: 24px 0 20px;
    }

    .cd-footer__text {
        font-size: 1.025rem;
    }

    .cd-footer__copyright {
        margin-bottom: 12px;
    }

    .cd-footer__social {
        gap: 12px;
    }

    .cd-footer__social-link svg {
        width: 18px;
        height: 18px;
    }

    /* Botones flotantes móvil */
    .cd-whatsapp-float {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 12px;
    }

    .cd-whatsapp-float svg {
        width: 26px;
        height: 26px;
    }

    .cd-scroll-top {
        bottom: 15px;
        right: 24px !important;
        left: auto !important;
        margin-left: 0 !important;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
}

/* Móviles muy pequeños (< 360px) */
@media (max-width: 360px) {
    html {
        font-size: 16px;
    }

    body {
        font-size: 17px;
    }

    .cd-container {
        padding: 0 10px;
    }

    .cd-header__logo {
        max-width: 55%;
        margin-left: 2px;
    }

    .cd-header__logo img {
        max-height: 45px;
    }

    .cd-header--fixed.is-scrolled .cd-header__logo img {
        max-height: 40px;
    }

    .cd-category__title {
        font-size: 1.75rem;
    }

    .cd-card__body {
        padding: 14px;
    }

    .cd-card__name {
        font-size: 1.125rem;
        font-weight: 700;
        padding-left: 48px;
    }

    .cd-card__price {
        font-size: 1.1875rem;
        padding-left: 48px;
    }

    .cd-card__desc {
        font-size: 0.9375rem;
        padding-left: 48px;
    }
}

/* ========================================
   TARJETAS CON IMAGEN
   ======================================== */

.cd-card--with-image {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cd-card--with-image:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.cd-card--with-image:active {
    transform: translateY(-4px);
}

.cd-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-secondary);
}

.cd-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.cd-card--with-image:hover .cd-card__img {
    transform: scale(1.05);
}

/* Ajustar header cuando hay imagen */
.cd-card--with-image .cd-card__header {
    margin-bottom: 12px;
}

/* Ajustar precio en header */
.cd-card--with-image .cd-card__price {
    font-size: 1rem;
    white-space: nowrap;
}

/* ========================================
   MODAL DE IMAGEN
   ======================================== */

.cd-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cd-image-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.cd-image-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.cd-image-modal__container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    z-index: 1;
}

.cd-image-modal.is-open .cd-image-modal__container {
    transform: scale(1);
}

.cd-image-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.cd-image-modal__close:hover {
    background: white;
    transform: scale(1.1);
}

.cd-image-modal__close svg {
    color: #333;
}

.cd-image-modal__content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

.cd-image-modal__header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid var(--color-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.cd-image-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    flex: 1;
}

.cd-image-modal__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.cd-image-modal__image-wrapper {
    position: relative;
    width: 100%;
    background: #f5f5f5;
}

.cd-image-modal__image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 60vh;
    object-fit: contain;
}

.cd-image-modal__description {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-light);
    margin: 0;
    background: white;
}

/* Responsive modal */
@media (max-width: 768px) {
    .cd-image-modal__container {
        width: 95%;
        max-height: 95vh;
    }

    .cd-image-modal__header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .cd-image-modal__title {
        font-size: 1.25rem;
    }

    .cd-image-modal__price {
        font-size: 1.25rem;
    }

    .cd-image-modal__description {
        padding: 16px;
        font-size: 0.95rem;
    }

    .cd-image-modal__image {
        max-height: 50vh;
    }

    .cd-image-modal__close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .cd-image-modal__container {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .cd-image-modal__header {
        padding: 12px;
    }

    .cd-image-modal__title {
        font-size: 1.125rem;
    }

    .cd-image-modal__price {
        font-size: 1.125rem;
    }

    .cd-image-modal__description {
        padding: 12px;
        font-size: 0.9rem;
    }
}
