/* ================================================================
   DANA GROOMING — SHOP
   Tienda, tarjetas de producto, página de producto y carrito.
   ================================================================ */

:root {
    --dg-pink:      #FF4880;
    --dg-pink-dark: #e0336a;
    --dg-pink-soft: #fff0f5;
    --dg-ink:       #1a1a2e;
    --dg-muted:     #6b6b80;
    --dg-line:      rgba(255, 72, 128, .15);
    --dg-shadow:    0 6px 24px rgba(26, 26, 46, .06);
    --dg-shadow-hi: 0 16px 40px rgba(255, 72, 128, .18);
}

/* ── Buttons ── */
.dg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, background .2s, color .2s;
    -webkit-tap-highlight-color: transparent;
}
.dg-btn:active { transform: scale(.97); }
.dg-btn:disabled { opacity: .7; cursor: wait; }

.dg-btn-primary { background: var(--dg-pink); color: #fff; box-shadow: 0 6px 16px rgba(255, 72, 128, .3); }
.dg-btn-primary:hover { background: var(--dg-pink-dark); color: #fff; }

.dg-btn-outline { background: #fff; color: var(--dg-pink); border-color: var(--dg-pink); }
.dg-btn-outline:hover { background: var(--dg-pink); color: #fff; }

.dg-btn-dark { background: var(--dg-ink); color: #fff; }
.dg-btn-dark:hover { background: #000; color: #fff; }

.dg-btn-whatsapp { background: #25D366; color: #fff; }
.dg-btn-whatsapp:hover { background: #1ebe5a; color: #fff; }

.dg-btn-lg { padding: 15px 28px; font-size: 16px; }

/* ── Shop hero ── */
.dg-shop-hero {
    background: linear-gradient(135deg, #fff0f5 0%, #ffe1ec 50%, #eef1ff 100%);
    padding: 56px 0 40px;
    text-align: center;
}
.dg-shop-hero h1 {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    color: var(--dg-ink);
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 8px;
}
.dg-shop-hero h1 span { color: var(--dg-pink); }
.dg-shop-hero p { color: var(--dg-muted); max-width: 560px; margin: 0 auto; }

/* ── Toolbar: búsqueda, categorías, orden ── */
.dg-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--dg-line);
    padding: 14px 0;
}
.dg-search {
    position: relative;
    flex: 1 1 260px;
}
.dg-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dg-muted);
}
.dg-search input,
.dg-sort {
    width: 100%;
    border: 1.5px solid var(--dg-line);
    border-radius: 999px;
    padding: 11px 16px 11px 42px;
    font-size: 16px; /* evita el zoom automático de iOS */
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.dg-sort { padding-left: 16px; width: auto; min-width: 170px; }
.dg-search input:focus,
.dg-sort:focus { border-color: var(--dg-pink); box-shadow: 0 0 0 4px rgba(255, 72, 128, .12); }

.dg-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.dg-chips::-webkit-scrollbar { display: none; }
.dg-chip {
    flex: 0 0 auto;
    border: 1.5px solid var(--dg-line);
    background: #fff;
    color: var(--dg-ink);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.dg-chip:hover { border-color: var(--dg-pink); color: var(--dg-pink); }
.dg-chip.active { background: var(--dg-pink); border-color: var(--dg-pink); color: #fff; }
.dg-chip small { opacity: .7; font-weight: 500; margin-left: 2px; }

.dg-results { color: var(--dg-muted); font-size: 14px; }

.dg-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--dg-muted);
}
.dg-empty i { font-size: 48px; color: var(--dg-pink); opacity: .5; margin-bottom: 12px; }

/* ── Product card ── */
.dg-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--dg-line);
    box-shadow: var(--dg-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
}
.dg-card:hover { transform: translateY(-6px); box-shadow: var(--dg-shadow-hi); }

.dg-card-img {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--dg-pink-soft);
    overflow: hidden;
}
.dg-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}
.dg-card:hover .dg-card-img img { transform: scale(1.06); }

.dg-card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, .92);
    color: var(--dg-pink);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 999px;
}

.dg-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}
.dg-card-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.25;
    color: var(--dg-ink);
    text-decoration: none;
}
.dg-card-title:hover { color: var(--dg-pink); }
.dg-card-desc {
    color: var(--dg-muted);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dg-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 4px;
}
.dg-card-price { font-size: 20px; font-weight: 800; color: var(--dg-pink); }
.dg-card-link { font-size: 13px; font-weight: 600; color: var(--dg-ink); text-decoration: none; }
.dg-card-link:hover { color: var(--dg-pink); }
.dg-card .dg-btn { padding: 10px 14px; font-size: 14px; }

@media (max-width: 575.98px) {
    .dg-card-body { padding: 12px; }
    .dg-card-title { font-size: 15px; }
    .dg-card-desc { display: none; }
    .dg-card-price { font-size: 17px; }
    .dg-card-link { display: none; }
    .dg-card .dg-btn { font-size: 13px; padding: 9px 10px; }
}

/* ── Home: sección tienda ── */
.dg-home-shop { background: linear-gradient(180deg, #fff 0%, #fff0f5 100%); }

/* ── Product page ── */
.dg-breadcrumb {
    font-size: 14px;
    color: var(--dg-muted);
    padding: 18px 0 0;
}
.dg-breadcrumb a { color: var(--dg-muted); text-decoration: none; }
.dg-breadcrumb a:hover { color: var(--dg-pink); }
.dg-breadcrumb span { margin: 0 6px; opacity: .5; }

.dg-product-gallery {
    border-radius: 24px;
    overflow: hidden;
    background: var(--dg-pink-soft);
    aspect-ratio: 1 / 1;
    box-shadow: var(--dg-shadow);
}
.dg-product-gallery img { width: 100%; height: 100%; object-fit: cover; }

.dg-product-cat {
    display: inline-block;
    background: var(--dg-pink-soft);
    color: var(--dg-pink);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 5px 12px;
    border-radius: 999px;
}
.dg-product-title {
    font-family: 'Fredoka', sans-serif;
    font-weight: 700;
    color: var(--dg-ink);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 12px 0 8px;
}
.dg-product-price { font-size: 30px; font-weight: 800; color: var(--dg-pink); margin-bottom: 16px; }
.dg-product-desc { color: #444; line-height: 1.8; }
.dg-product-desc.collapsed { max-height: 9em; overflow: hidden; position: relative; }
.dg-product-desc.collapsed::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3em;
    background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.dg-readmore { background: none; border: 0; color: var(--dg-pink); font-weight: 600; padding: 0; }

.dg-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--dg-line);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.dg-qty button {
    width: 42px;
    height: 46px;
    border: 0;
    background: transparent;
    color: var(--dg-pink);
    font-size: 20px;
    font-weight: 700;
}
.dg-qty button:hover { background: var(--dg-pink-soft); }
.dg-qty input {
    width: 44px;
    border: 0;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    -moz-appearance: textfield;
}
.dg-qty input::-webkit-outer-spin-button,
.dg-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dg-qty-sm button { width: 34px; height: 36px; font-size: 17px; }
.dg-qty-sm input { width: 34px; font-size: 15px; }

.dg-perks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 24px;
}
.dg-perk {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafafe;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 12px;
    font-size: 13px;
    color: var(--dg-ink);
}
.dg-perk i { color: var(--dg-pink); font-size: 18px; }

/* Barra fija "Add to cart" en móvil (página de producto) */
.dg-sticky-buy {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1040;
    background: #fff;
    border-top: 1px solid var(--dg-line);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    display: none;
    align-items: center;
    gap: 12px;
}
.dg-sticky-buy .dg-card-price { white-space: nowrap; }
@media (max-width: 991.98px) {
    .dg-sticky-buy { display: flex; }
    body.has-sticky-buy { padding-bottom: 76px; }
    body.has-sticky-buy .dg-cart-fab { bottom: 92px; }
    body.has-sticky-buy .back-to-top { bottom: 150px !important; }
}

/* ── Cart page ── */
.dg-cart-item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f4;
}
.dg-cart-item img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--dg-pink-soft);
}
.dg-cart-item-name {
    font-weight: 700;
    color: var(--dg-ink);
    text-decoration: none;
    font-size: 16px;
}
.dg-cart-item-name:hover { color: var(--dg-pink); }
.dg-cart-item-meta { color: var(--dg-muted); font-size: 13px; }
.dg-cart-remove {
    background: none;
    border: 0;
    color: var(--dg-muted);
    font-size: 13px;
    padding: 0;
}
.dg-cart-remove:hover { color: #dc3545; }
.dg-cart-subtotal { font-weight: 800; color: var(--dg-ink); text-align: right; }

.dg-summary {
    background: #fff;
    border: 1px solid var(--dg-line);
    border-radius: 20px;
    box-shadow: var(--dg-shadow);
    padding: 24px;
    position: sticky;
    top: 20px;
}
.dg-summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--dg-muted); }
.dg-summary-total {
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed #ddd;
    padding-top: 14px;
    margin-top: 6px;
    font-weight: 800;
    font-size: 20px;
    color: var(--dg-ink);
}

@media (max-width: 575.98px) {
    .dg-cart-item { grid-template-columns: 72px 1fr; }
    .dg-cart-item img { width: 72px; height: 72px; }
    .dg-cart-subtotal { grid-column: 2; text-align: left; }
}

/* ── Botón flotante del carrito ── */
.dg-cart-fab {
    position: fixed;
    right: 24px;
    bottom: 90px;
    z-index: 1050;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--dg-pink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 24px rgba(255, 72, 128, .45);
    border: 0;
    transition: transform .2s;
}
.dg-cart-fab:hover { color: #fff; transform: scale(1.06); }
.dg-cart-fab.bump { animation: dgBump .45s; }
@keyframes dgBump { 30% { transform: scale(1.25); } 60% { transform: scale(.95); } }

.cart-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--dg-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icono de carrito en el navbar */
.dg-nav-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dg-pink-soft);
    color: var(--dg-pink);
    font-size: 18px;
}
.dg-nav-cart:hover { background: var(--dg-pink); color: #fff; }

/* ── Mini cart (offcanvas) ── */
.dg-mini-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f4;
}
.dg-mini-item img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--dg-pink-soft);
}

/* ── Toast ── */
#cart-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    z-index: 9999;
    background: var(--dg-ink);
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px 12px 18px;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 32px);
}
#cart-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#cart-toast a {
    color: #fff;
    background: var(--dg-pink);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}
