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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f4f4f6;
    color: #222;
    line-height: 1.5;
    overflow-y: scroll;
}

.top-bar {
    color: #fff;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    background-color: #000;
}
@media (min-width: 600px) {
    .top-bar {
        animation: flashBanner 10s forwards;
    }
}
@media (max-width: 599px) {
    .top-bar {
        animation: flashBannerMobile 10s forwards;
    }
}
@keyframes flashBannerMobile {
    0% { background-image: url('/img/banner.png'); background-size: cover; background-position: left top; }
    2% { background-image: none; }
    4% { background-image: url('/img/banner.png'); background-size: cover; background-position: left top; }
    6% { background-image: none; }
    8% { background-image: url('/img/banner.png'); background-size: cover; background-position: left top; }
    10% { background-image: none; }
    12%, 100% { background-image: url('/img/banner.png'); background-size: cover; background-position: left top; }
}
@keyframes flashBanner {
    0% { background-image: url('/img/banner.png'); background-size: cover; background-position: center; }
    2% { background-image: none; }
    4% { background-image: url('/img/banner.png'); background-size: cover; background-position: center; }
    6% { background-image: none; }
    8% { background-image: url('/img/banner.png'); background-size: cover; background-position: center; }
    10% { background-image: none; }
    12%, 100% { background-image: url('/img/banner.png'); background-size: cover; background-position: center; }
}

.top-bar .logo {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    line-height: 1;
    z-index: 1;
}

.top-bar .search-box {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: 380px;
    margin-left: auto;
    align-items: center;
    gap: 0;
}

.top-bar .search-box input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    font-size: 0.9em;
    font-family: inherit;
    background: rgba(255,255,255,0.12);
    color: #fff;
    min-width: 0;
}

.top-bar .search-box input::placeholder {
    color: rgba(255,255,255,0.55);
}

.top-bar .search-box .search-btn-text {
    padding: 8px 14px;
    border: none;
    background: #e94560;
    color: #fff;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    font-family: inherit;
}

.top-bar .search-box .search-btn-icon {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.top-bar .search-box .search-btn-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Hamburger menu toggle (hidden on desktop) */
.cat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.cat-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
}

.home-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Categories nav: dropdown overlay on mobile, horizontal scroll on desktop */
.cat-nav {
    background: #fff;
    display: none;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1px solid #e8e8ec;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 50vh;
    overflow-y: auto;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 6px 0;
}

.cat-nav.open {
    display: flex;
    animation: slideDown 0.2s ease-out both;
}

.cat-nav.closing {
    display: flex;
    animation: slideUp 0.15s ease-in both;
    pointer-events: none;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        max-height: 50vh;
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        max-height: 50vh;
        opacity: 1;
        transform: translateY(0);
    }
    to {
        max-height: 0;
        opacity: 0;
        transform: translateY(-8px);
    }
}

.cat-nav button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.88em;
    font-family: inherit;
    color: #444;
    transition: background 0.15s;
}

.cat-nav button:hover, .cat-nav button.active {
    background: #f0f0f5;
    color: #1a1a2e;
    font-weight: 600;
}

/* Overlay behind categories menu */
.cat-overlay {
    display: none;
    position: fixed;
    top: 52px; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9998;
}

.cat-overlay.open {
    display: block;
    animation: fadeIn 0.2s ease-out both;
}

.cat-overlay.closing {
    display: block;
    animation: fadeOut 0.15s ease-in both;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.store-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: #e94560;
    color: #fff;
    font-size: 0.62em;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.product-card:active {
    transform: scale(0.97);
}

.product-card .img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.product-card .info {
    padding: 10px 12px 14px;
}

.product-card .info h3 {
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    color: #222;
}

.product-card .info .price {
    font-size: 1.05em;
    font-weight: 700;
    color: #e94560;
}

.product-card .info .stock {
    font-size: 0.72em;
    color: #999;
    margin-top: 3px;
}

/* Product detail */
.product-detail {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-top: 0;
    isolation: isolate;
}

.product-detail .img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 400px;
    background: #f8f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-detail .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

.product-detail .info {
    padding: 20px;
}

.product-detail .info h1 {
    font-size: 1.25em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
    line-height: 1.3;
}

.product-detail .info .price {
    font-size: 1.6em;
    font-weight: 700;
    color: #e94560;
    margin-bottom: 14px;
}

.product-detail .info .desc {
    font-size: 0.88em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 12px;
}
.product-detail .info .desc.desc-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.desc-full {
    font-size: 0.88em;
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
}

.product-detail .info .garantia {
    font-size: 0.82em;
    color: #1a7f4a;
    padding: 8px 14px;
    background: #eafaf2;
    border-radius: 8px;
    display: inline-block;
    line-height: 1;
}

.product-detail .info .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    display: block;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
}

.btn-whatsapp:hover { background: #1da851; }

/* Back link: pill button */
.back-bar {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: #fff;
    color: #444;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: background 0.15s;
    font-family: inherit;
}

.back-link:hover { background: #f0f0f2; }

.back-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.site-footer {
    text-align: center;
    padding: 28px 16px 20px;
    font-size: 0.82em;
    color: #999;
    border-top: 1px solid #e0e0e5;
    margin-top: 20px;
    background: #fff;
}

.footer-heading {
    font-size: 0.95em;
    font-weight: 600;
    color: #444;
    margin-bottom: 14px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #1a1a2e;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.social-icon:hover {
    background: #e94560;
    transform: scale(1.1);
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.footer-text {
    color: #aaa;
    font-size: 0.85em;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 0.95em;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    grid-column: 1 / -1;
    font-size: 0.9em;
}

#payment-methods .pm-title {
    font-size: 0.85em;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
}
#payment-methods .pm-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
#payment-methods .pm-item svg {
    width: 44px;
    height: 44px;
    display: block;
}
#payment-methods .pm-delivery {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82em;
    color: #555;
    background: #f0f8ff;
    padding: 8px 12px;
    border-radius: 8px;
}
#payment-methods .pm-moto {
    flex-shrink: 0;
    color: #e94560;
}

/* Mobile: search as expandable overlay */
@media (max-width: 599px) {
    .top-bar {
        background-position: left top;
    }
    .top-bar .search-box .search-btn-text {
        display: none;
    }
    .top-bar .search-box .search-btn-icon {
        display: flex;
    }
    .top-bar .search-box input {
        width: 0;
        padding: 8px 0;
        border: none;
        opacity: 0;
        transition: width 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    }
    .top-bar .search-box.expanded {
        position: absolute;
        left: 10px;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        max-width: none;
        margin-left: 0;
        z-index: 10;
        background: #1a1a2e;
        border-radius: 8px;
        padding: 4px 6px;
        display: flex;
        gap: 6px;
    }
    .top-bar .search-box.expanded input {
        width: 100%;
        padding: 8px 12px;
        opacity: 1;
        border-radius: 6px;
        background: rgba(255,255,255,0.15);
    }
    .top-bar .search-box.expanded .search-btn-icon {
        background: #e94560;
        border-radius: 6px;
    }
    .top-bar.search-open .logo {
        opacity: 0;
        pointer-events: none;
    }
    .top-bar .logo {
        margin-left: 10px !important;
        transition: opacity 0.25s ease;
    }
}

/* Desktop & tablet breakpoints */
@media (min-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .container { padding: 16px; padding-top: 90px; }
    .product-card .info h3 { font-size: 0.9em; }
    .product-card .info .price { font-size: 1.1em; }
    .top-bar .logo { font-size: 26px; }
    .cat-toggle { display: none; }
    .home-btn { display: flex; width: 44px; height: 44px; background: rgba(255,255,255,0.25); }
    .cat-overlay, .cat-overlay.open, .cat-overlay.closing { display: none !important; }
    .top-bar .search-box .search-btn-icon { display: none !important; }
    .top-bar .search-box .search-btn-text { display: inline-block; }
    .cat-nav {
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid #e8e8ec;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 99;
        padding: 18px 16px 8px;
        box-shadow: none;
        max-height: none;
        animation: none;
    }
    .cat-nav.open, .cat-nav.closing {
        display: flex;
        animation: none;
        pointer-events: auto;
    }
    .cat-nav::-webkit-scrollbar { display: none; }
    .cat-nav button {
        flex-shrink: 0;
        width: auto;
        text-align: center;
        padding: 6px 14px;
        border: 1px solid #e0e0e5;
        background: #fff;
        border-radius: 18px;
        font-size: 0.82em;
        color: #444;
        transition: all 0.2s;
    }
    .cat-nav button:hover, .cat-nav button.active {
        background: #1a1a2e;
        color: #fff;
        border-color: #1a1a2e;
        font-weight: normal;
    }
}

@media (min-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
    .container { padding: 24px; padding-top: 70px; }
    .top-bar { padding: 12px 24px; }
    .top-bar .logo { font-size: 30px; }
    .cat-nav { padding: 20px 24px 10px; gap: 8px; top: 54px; }
    .cat-overlay { display: none !important; }

    .product-detail {
        flex-direction: row;
        gap: 0;
    }
    .product-detail .info {
        flex: 1;
        padding: 32px;
    }
    .product-detail .info h1 { font-size: 1.5em; }
    .product-detail .info .price { font-size: 1.8em; }
    .product-detail .info .actions {
        flex-direction: row;
    }
    .btn {
        flex: 1;
    }
    .back-link { font-size: 0.88em; }
}

/* Similar products */
.similar-products {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px;
}
.similar-products .section-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #1a1a2e;
    margin: 24px 0 12px;
}
.similar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (max-width: 599px) {
    .similar-grid .product-card:nth-child(n+3) {
        display: none;
    }
}
@media (min-width: 600px) {
    .similar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    .similar-products {
        padding: 0 16px;
    }
}
@media (min-width: 900px) {
    .similar-products {
        padding: 0 24px;
    }
}

/* Footer */
.site-footer {
    padding: 32px 16px 24px;
    border-top: 1px solid #e0e0e5;
    margin-top: 30px;
    background: #fff;
    color: #555;
    font-size: 0.84em;
    line-height: 1.6;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 600px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 28px;
        text-align: left;
    }
}
.footer-col h3 {
    font-size: 0.95em;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.footer-col p {
    color: #666;
    margin-bottom: 6px;
}
.footer-col .social-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}
.footer-col .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1a1a2e;
    text-decoration: none;
    transition: background 0.2s;
}
.footer-col .social-links a:hover {
    background: #e94560;
}
.footer-col .social-links a svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}
.footer-col .footer-text {
    font-size: 0.8em;
    color: #999;
    margin-top: 8px;
}
.stock-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.88em;
    flex-wrap: wrap;
}
.stock-row .prod-estado-label {
    color: #222;
    font-weight: 500;
}
.stock-row .stock-label {
    color: #28a745;
}
.stock-row .interesados {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #dc3545;
}
.stock-row .users-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.product-card.agotado {
    opacity: 0.7;
}
.product-card.agotado .stock {
    color: #dc3545 !important;
    font-weight: bold;
}

/* Gallery Slider */
.product-detail .gallery-section {
    width: 100%;
}

.product-detail .gallery-section .img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 400px;
    background: #f8f8fa;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail .gallery-section .img-wrap .slides {
    display: flex;
    transition: none !important;
    width: 100%;
    height: 100%;
}

.product-detail .gallery-section .img-wrap .slides .slide {
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    height: 100%;
}

.product-detail .gallery-section .img-wrap .slides .slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
}

/* Gallery dots */
.product-detail .gallery-section .gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 10px;
    background: #f8f8fa;
}

.product-detail .gallery-section .gallery-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.product-detail .gallery-section .gallery-dots .dot.active {
    background: #e94560;
}

/* Product images grid (no carousel) */
.product-images-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.product-image-item {
    background: #f8f8fa;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
}
.product-image-item:hover {
    transform: scale(1.02);
}
.product-image-item:active {
    transform: scale(0.98);
}

.product-image-item img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    padding: 16px;
    display: block;
}

@media (min-width: 600px) {
    .product-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .product-images-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Fullscreen overlay */
.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fullscreen-overlay.open {
    display: flex;
}

.fullscreen-overlay .fs-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.15s;
    font-family: inherit;
}

.fullscreen-overlay .fs-close:hover {
    background: rgba(255,255,255,0.3);
}

.fullscreen-overlay .fs-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    touch-action: none;
}

.fullscreen-overlay .fs-slides {
    display: flex;
    touch-action: pan-y;
    height: 100%;
}

.fullscreen-overlay .fs-slides .fs-slide {
    min-width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.fullscreen-overlay .fs-slides .fs-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fullscreen-overlay .fs-counter {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-family: sans-serif;
}

/* Gallery thumbnails */
.gallery-thumbs {
    display: none;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px 14px;
    flex-wrap: wrap;
    background: #f8f8fa;
}

.gallery-thumbs .thumb {
    width: 52px;
    height: 52px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: none;
    transition: border-color 0.15s;
    flex-shrink: 0;
}

.gallery-thumbs .thumb:hover {
    border-color: #bbb;
}

.gallery-thumbs .thumb.active {
    border-color: #e94560;
}

.gallery-thumbs .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fullscreen thumbnails */
.fullscreen-overlay .fs-thumbs {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    overflow-x: auto;
    z-index: 5;
}

.fullscreen-overlay .fs-thumbs .fs-thumb {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    background: none;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.fullscreen-overlay .fs-thumbs .fs-thumb.active {
    border-color: #e94560;
}

.fullscreen-overlay .fs-thumbs .fs-thumb:hover {
    border-color: rgba(255,255,255,0.6);
}

.fullscreen-overlay .fs-thumbs .fs-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-detail .info .wa-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
    text-align: left;
    width: 100%;
}

/* Simple fullscreen (para Imágenes del producto) - solo imagen + cerrar */
.simple-fs-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.simple-fs-overlay.open {
    display: flex;
}
.simple-fs-overlay .sfs-img-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.simple-fs-overlay .sfs-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.simple-fs-overlay .sfs-close {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    font-family: inherit;
    margin: 12px auto 24px;
}
.simple-fs-overlay .sfs-close:hover {
    background: rgba(255,255,255,0.35);
}

/* Desktop >= 600px: show thumbs, hide dots */
@media (min-width: 600px) {
    .gallery-thumbs {
        display: flex;
    }
    .product-detail .gallery-section .gallery-dots {
        display: none !important;
    }
}

/* Desktop >= 900px: gallery-section takes left flex side */
@media (min-width: 900px) {
    .product-detail .gallery-section {
        flex: 1;
        max-width: 450px;
        min-height: 350px;
        display: flex;
        flex-direction: column;
    }
    .product-detail .gallery-section .img-wrap {
        flex: 1;
        aspect-ratio: auto;
        max-height: none;
        min-height: inherit;
    }
    .product-detail .gallery-section .img-wrap .slides .slide {
        height: 100%;
        min-height: 350px;
    }
    .product-detail .info .btn.btn-whatsapp {
        max-width: 40%;
    }
}

/* Guarantee + share row */
.product-detail .info .garantia-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.product-detail .info .share-btn {
    background: #e8f0fe;
    border: 1px solid #b3d4fc;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1a73e8;
    font-size: 0.82em;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s;
    flex-shrink: 0;
    line-height: 1;
    white-space: nowrap;
}

.product-detail .info .share-btn:hover {
    background: #d2e3fc;
    border-color: #8ab4f8;
    color: #1557b0;
}

.product-detail .info .share-btn svg {
    width: 15px;
    height: 15px;
}

/* Share modal */
.share-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.share-modal.open {
    display: flex;
}

.share-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px 28px;
    max-width: 340px;
    width: 90%;
    position: relative;
    text-align: center;
}

.share-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 4px;
    line-height: 1;
}

.share-modal-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
    text-align: center;
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.share-option {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 4px;
    font-family: inherit;
    font-size: 0.78em;
    color: #555;
    transition: transform 0.1s;
}

.share-option:active {
    transform: scale(0.95);
}

.share-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.share-icon.whatsapp {
    background: #25d366;
    color: #fff;
}

.share-icon.facebook {
    background: #1877f2;
    color: #fff;
}

.share-icon.link {
    background: #555;
    color: #fff;
}

.share-option:hover .share-icon {
    transform: scale(1.08);
}

.top-bar .home-btn {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    margin-left: 0;
}
@media (min-width: 600px) {
    .top-bar .home-btn {
        width: 70px;
        margin-left: 5%;
    }
}
.top-bar .home-btn svg {
    width: 26px;
    height: 26px;
}
.back-bar {
    display: none !important;
}

/* Saber mas section */
.saber-mas {
    background: #fff;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-top: 12px;
    text-align: center;
}
.saber-mas .sm-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.saber-mas .sm-desc {
    font-size: 0.88em;
    color: #666;
    margin-bottom: 16px;
}
.saber-mas .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}
@media (min-width: 600px) {
    .saber-mas .actions {
        flex-direction: row;
    }
    .saber-mas .actions .btn {
        flex: 1;
    }
}

/* Infinite scroll placeholders */
.product-card.is-placeholder {
    min-height: 180px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: default;
    opacity: 0.35;
}

/* ==================== CHATBOT ==================== */
.chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s, box-shadow 0.25s;
}
.chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}
.chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}
.chat-speech {
    position: fixed;
    bottom: 82px;
    right: 24px;
    background: #fff;
    color: #333;
    padding: 8px 14px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    font-size: 0.85em;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    z-index: 1002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(6px) scale(0.92);
}
.chat-speech.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.chat-speech::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 2px 2px 3px rgba(0,0,0,0.05);
}
.chat-bubble.bot-thinking {
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.chat-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideIn 0.3s ease;
}
.chat-panel.open {
    display: flex;
}
@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    background: #075e54;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.chat-header .chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #128c7e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}
.chat-header .chat-header-info {
    flex: 1;
    min-width: 0;
}
.chat-header .chat-header-info .chat-name {
    font-weight: 600;
    font-size: 0.95em;
}
.chat-header .chat-header-info .chat-status {
    font-size: 0.75em;
    opacity: 0.8;
}
.chat-header .chat-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    font-size: 1.3em;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.chat-header .chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    background: #ece5dd;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

.chat-msg {
    max-width: 85%;
    padding: 8px 13px;
    border-radius: 10px;
    font-size: 0.88em;
    line-height: 1.45;
    word-wrap: break-word;
    animation: msgIn 0.25s ease;
    position: relative;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.bot {
    align-self: flex-start;
    background: #fff;
    border-bottom-left-radius: 3px;
    color: #1a1a2e;
}
.chat-msg.user {
    align-self: flex-end;
    background: #dcf8c6;
    border-bottom-right-radius: 3px;
    color: #1a1a2e;
}
.chat-msg .msg-time {
    font-size: 0.65em;
    color: #999;
    text-align: right;
    margin-top: 3px;
}

.chat-msg .product-card-mini {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f8f8fa;
    border-radius: 8px;
    padding: 8px;
    margin: 4px 0;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
}
.chat-msg .product-card-mini:hover {
    background: #eef;
    border-color: #ccc;
}
.chat-msg .product-card-mini img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    background: #fff;
}
.chat-msg .product-card-mini .pcm-info {
    flex: 1;
    min-width: 0;
}
.chat-msg .product-card-mini .pcm-info .pcm-name {
    font-weight: 600;
    font-size: 0.9em;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chat-msg .product-card-mini .pcm-info .pcm-price {
    font-weight: 700;
    color: #e94560;
    font-size: 0.9em;
    margin-top: 2px;
}
.chat-msg .product-card-mini .pcm-wa {
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s;
}
.chat-msg .product-card-mini .pcm-wa:hover {
    background: #1da851;
}

.chat-msg .chat-btn {
    display: inline-block;
    background: #128c7e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin: 3px 4px 3px 0;
    transition: background 0.2s;
    text-align: center;
}
.chat-msg .chat-btn:hover {
    background: #075e54;
}
.chat-msg .chat-btn.wa {
    background: #25d366;
}
.chat-msg .chat-btn.wa:hover {
    background: #1da851;
}
.chat-msg .chat-btn.asesor {
    background: #f39c12;
}
.chat-msg .chat-btn.asesor:hover {
    background: #d68910;
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #f0f0f0;
    flex-shrink: 0;
    border-top: 1px solid #e0e0e0;
}
.chat-input-area input {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.88em;
    outline: none;
    background: #fff;
}
.chat-input-area .chat-send {
    background: #128c7e;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.chat-input-area .chat-send:hover {
    background: #075e54;
}
.chat-input-area .chat-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.chat-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 10px;
    border-bottom-left-radius: 3px;
    align-items: center;
}
.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #999;
    animation: typingDot 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); background: #999; }
    30% { transform: translateY(-5px); background: #555; }
}

@media (max-width: 480px) {
    .chat-panel {
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    .chat-bubble {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }
    .chat-bubble svg {
        width: 24px;
        height: 24px;
    }
    .chat-speech {
        bottom: 76px;
        right: 16px;
        font-size: 0.78em;
        padding: 6px 12px;
        max-width: 180px;
        white-space: normal;
    }
    .chat-speech::after {
        right: 18px;
    }
}
