:root {
    --bg: #2c2c2c;
    --fb-accent: #4f6ef7;
    --fb-accent-soft: rgba(79, 110, 247, 0.16);
    --ctrl-bg: #4a90d9;
    --ctrl-hover: #357abd;
    --text: #ccc;
    --text-muted: #888;
    --sep: #555;
    --border: rgba(255, 255, 255, 0.1);
    --input-bg: #1e1e1e;
    --overlay-bg: rgba(0, 0, 0, 0.92);
    --flipbook-card-bg: #1e1e1e;
    --flipbook-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    --sidebar-bg: #1e1e1e;
    --sidebar-text: #fff;
    --sidebar-border: #333;
    --sidebar-item-bg: #2c2c2c;
    --sidebar-item-hover: #363636;
    --sidebar-muted: rgba(255, 255, 255, 0.45);
    --sidebar-chip: rgba(255, 255, 255, 0.09);
}

body.light {
    --bg: #e8e8e8;
    --ctrl-bg: #2c7bc0;
    --ctrl-hover: #1a5f94;
    --text: #555;
    --text-muted: #999;
    --sep: #bbb;
    --border: rgba(0, 0, 0, 0.1);
    --input-bg: #fff;
    --overlay-bg: rgba(255, 255, 255, 0.92);
    --flipbook-card-bg: #ffffff;
    --flipbook-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    --sidebar-bg: #f5f5f5;
    --sidebar-text: #333;
    --sidebar-border: #ddd;
    --sidebar-item-bg: #fff;
    --sidebar-item-hover: #f0f2f8;
    --sidebar-muted: rgba(0, 0, 0, 0.45);
    --sidebar-chip: rgba(0, 0, 0, 0.05);
}

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

body {
    background: var(--bg);
    font-family: Arial, sans-serif;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    transition: background .3s;
}

#flipbook {
    width: 1100px;
    height: 780px;
    max-width: 100%;
}

#flipbook .page-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #fff;
    container-type: size;
   /*box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.06), 1px 0 6px rgba(0, 0, 0, 0.08);*/
}

#flipbook .turn-reveal {
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
}

#flipbook .turn-shadow {
    opacity: 0.4 !important;
}

#flipbook .even .page-wrapper {
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.04), -1px 0 6px rgba(0, 0, 0, 0.06);
}

#flipbook .odd .page-wrapper {
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.04), 1px 0 6px rgba(0, 0, 0, 0.06);
}

#flipbook .page-wrapper img { width:100%; height:100%; display:block; object-fit:cover; border-radius: 10px;}

#flipbook .watermark {
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 50;
    max-width: 120px;
    max-height: 60px;
}

#flipbook .assets-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#flipbook .assets-layer .asset {
    position: absolute;
    pointer-events: auto;
    overflow: visible;
}

#flipbook .assets-layer .asset iframe,
#flipbook .assets-layer .asset video {
    width: 100%;
    height: 100%;
    border: none;
}

#flipbook .assets-layer .asset.frame {
    border: 4px solid #d4a017;
    border-radius: 4px;
    pointer-events: none;
}

#flipbook .assets-layer .asset.text {
    font-size: inherit;
    color: inherit;
    pointer-events: none;
    line-height: 1.3;
}

#flipbook .assets-layer .asset.text .asset-text-inner {
    font-size: inherit;
}

#flipbook .assets-layer .asset.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Floating controls bar */
#float-controls {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    bottom: 16px;
    padding-bottom: 0px;
    padding-bottom: constant(safe-area-inset-bottom, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    pointer-events: none;
}

#float-controls .fc-inner {
    pointer-events: auto;
}

#site-copyright {
    position: fixed;
    right: 24px;
    bottom: 10px;
    z-index: 99998;
    text-align: right;
    font-size: 10px;
    line-height: 1.6;
    color: var(--text-muted, #999);
    pointer-events: none;
    white-space: nowrap;
}

#site-copyright span {
    display: block;
    white-space: nowrap;
}

#site-copyright span:last-child {
    pointer-events: auto;
}

#site-copyright a {
    color: var(--fb-accent, #4f6ef7);
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
}

#site-copyright a:hover {
    opacity: .8;
}

@media (max-width: 768px) {
    #site-copyright {
        right: 16px;
        bottom: 8px;
        font-size: 8px;
    }
}

.fc-inner {
    display: flex;
    gap: 4px;
    align-items: center;
    background: var(--flipbook-card-bg, #1e1e1e);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 50px;
    padding: 8px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fc-inner button,
.fc-inner .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    color: var(--text);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    transition: background .18s, color .18s, transform .12s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.fc-inner button:hover,
.fc-inner .btn:hover {
    background: var(--fb-accent-soft);
    color: var(--fb-accent);
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}

.fc-inner button:active {
    transform: translateY(0) scale(.9);
}

.fc-inner button.active {
    background: var(--fb-accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(79, 110, 247, 0.5);
}

.fc-sep {
    width: 1px;
    height: 20px;
    background: var(--sep, rgba(255, 255, 255, 0.15));
    flex-shrink: 0;
    margin: 0 4px;
}

#page-input {
    width: 40px;
    padding: 4px 2px;
    text-align: center;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: 4px;
    background: var(--input-bg, rgba(255, 255, 255, 0.08));
    color: var(--text);
    font-size: 13px;
    outline: none;
    flex-shrink: 0;
}

#page-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

#page-total {
    color: var(--text-muted, #999);
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

#loading {
    color: var(--text);
    font-size: 18px;
    text-align: center;
    padding: 40px;
}

body.has-header {
    padding: 0 0 80px;
    align-items: flex-start;
}

.catalog-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

#flipbook-container.has-header {
    margin-top: calc(var(--header-h, 60px) + 4px);
}

#flipbook-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flipbook-card {
    background: var(--flipbook-card-bg, #1e1e1e);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
}

.catalog-header .header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.catalog-header .header-logo {
    max-height: 80%;
    width: auto;
    display: block;
    object-fit: contain;
}

.catalog-header .header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.catalog-header .header-name {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
}

.catalog-header .header-info {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.2;
}

.social-bar {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 100;
    display: flex;
    gap: 6px;
}

.social-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: background .2s;
}

.social-bar a:hover {
    background: rgba(0, 0, 0, 0.7);
}

.products-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: var(--sidebar-bg);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform .3s;
    padding: 60px 15px 20px;
    overflow-y: auto;
}

.products-sidebar.open {
    transform: translateX(0);
}

.products-sidebar h3 {
    color: var(--sidebar-text);
    font-size: 16px;
    margin-bottom: 15px;
}

.products-sidebar .prod-card {
    background: var(--sidebar-item-bg);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.products-sidebar .prod-card h4 {
    color: var(--sidebar-text);
    font-size: 14px;
}

.products-sidebar .prod-card p {
    color: #888;
    font-size: 12px;
    margin: 4px 0;
}

.products-sidebar .prod-card .price {
    color: #4a90d9;
    font-weight: bold;
    font-size: 16px;
    display: block;
    margin: 5px 0;
}

.products-sidebar .prod-card button {
    width: 100%;
    padding: 7px;
    background: #e67e22;
}

.products-sidebar .prod-card button:hover {
    background: #d35400;
}

.products-sidebar .close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 24px;
    cursor: pointer;
}

.products-sidebar .cart-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.products-sidebar .cart-actions .btn-ws {
    flex: 1;
    padding: 10px;
    background: #25D366;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    display: none;
    transition: all .2s;
}

.products-sidebar .cart-actions .btn-ws:hover {
    background: #1ebe5e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.products-sidebar .cart-actions .btn-clear {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: none;
    transition: all .2s;
    line-height: 1;
}

.products-sidebar .cart-actions .btn-clear:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    transform: translateY(-1px);
}

.products-sidebar .cart-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 38px 10px 12px;
    margin-bottom: 8px;
    background: var(--sidebar-item-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 10px;
    transition: background .15s, border-color .15s;
}

.products-sidebar .cart-item:hover {
    background: var(--sidebar-item-hover);
    border-color: var(--fb-accent);
}

.products-sidebar .cart-item .ci-main {
    flex: 1 1 auto;
    min-width: 0;
}

.products-sidebar .cart-item .ci-name {
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.products-sidebar .cart-item .ci-meta {
    color: var(--sidebar-muted);
    font-size: 10px;
    margin-top: 2px;
    letter-spacing: .3px;
}

.products-sidebar .cart-item .ci-desc {
    color: var(--sidebar-muted);
    font-size: 10px;
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

.products-sidebar .cart-item .ci-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.products-sidebar .cart-item .ci-price {
    color: var(--sidebar-text);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

.products-sidebar .cart-item .ci-qty {
    display: inline-flex;
    align-items: center;
    background: var(--sidebar-chip);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.products-sidebar .cart-item .ci-qty-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--sidebar-text);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: background .15s, color .15s;
}

.products-sidebar .cart-item .ci-qty-btn:hover {
    background: var(--fb-accent);
    color: #fff;
}

.products-sidebar .cart-item .ci-qty .ci-qty-val {
    color: var(--sidebar-text);
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.products-sidebar .cart-item .cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--sidebar-muted);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background .15s, color .15s;
}

.products-sidebar .cart-item .cart-item-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

#cart-sidebar-empty {
    color: #888;
}

#cart-sidebar-total {
    color: var(--sidebar-text);
    border-top: 1px solid var(--sidebar-border);
}

#cart-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1002;
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--flipbook-card-bg);
    color: var(--text);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: background .25s, color .25s, box-shadow .25s, transform .2s;
    backdrop-filter: blur(8px);
}

#cart-toggle.hidden {
    display: none;
}

#cart-toggle:hover {
    background: var(--fb-accent);
    color: #fff;
    border-color: var(--fb-accent);
    box-shadow: 0 6px 18px rgba(79, 110, 247, 0.45);
    transform: translateY(-2px);
}

#cart-toggle .icon-cart {
    font-size: 19px;
    line-height: 1;
}

body.has-header #cart-toggle {
    top: calc(15px + var(--header-h, 60px));
}

#cart-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #fff;
    border-radius: 50px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--flipbook-card-bg);
}

#cart-count.empty {
    display: none;
}

.cart-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.cart-popup {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    width: 400px;
    max-width: 94vw;
    max-height: 84vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    animation: cpop-in .22s ease;
}

@keyframes cpop-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.cp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #eef2f7;
    flex-shrink: 0;
}

.cp-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-header h3 i {
    color: var(--fb-accent, #4f6ef7);
}

.cp-x {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all .15s;
    flex-shrink: 0;
}

.cp-x:hover { background: #e2e8f0; color: #1e293b; }

.cp-list {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.cart-popup .cp-item { margin-bottom: 8px; }
.cart-popup .cp-item:last-child { margin-bottom: 0; }

.cart-popup .cp-item-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s;
}

.cart-popup .cp-item-label:hover {
    border-color: #c7d2fe;
    background: #fafbff;
}

.cart-popup .cp-item-label:has(.cp-cb:checked) {
    border-color: var(--fb-accent, #4f6ef7);
    background: #f0f3ff;
}

.cart-popup .cp-item-label.cp-inactive {
    opacity: .6;
    cursor: default;
}

.cart-popup .cp-cb {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    cursor: pointer;
    accent-color: var(--fb-accent, #4f6ef7);
}

.cart-popup .cp-cb-ph {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 4px;
    background: #e2e8f0;
    display: inline-block;
}

.cart-popup .cp-item-body { flex: 1; min-width: 0; }

.cart-popup .cp-item .cp-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    word-break: break-word;
}

.cart-popup .cp-item .cp-meta {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
    letter-spacing: .3px;
}

.cart-popup .cp-item .cp-desc {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 190px;
}

.cart-popup .cp-item .cp-price {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
}

.cp-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #eef2f7;
    flex-shrink: 0;
}

.cart-popup #cp-count {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-align: center;
    margin-bottom: 10px;
}

.cart-popup .cp-actions {
    display: flex;
    gap: 8px;
}

.cart-popup .cp-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .18s;
}

.cart-popup .cp-actions .btn-cart {
    background: var(--fb-accent, #4f6ef7);
    color: #fff;
}

.cart-popup .cp-actions .btn-cart:hover {
    background: #3d5bd9;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(79, 110, 247, .4);
}

.cart-popup .cp-actions .btn-ws {
    background: #25D366;
    color: #fff;
}

.cart-popup .cp-actions .btn-ws:hover { background: #1ebe5e; }

.cart-btn:hover {
    transform: scale(1.05);
}

.cart-btn:active {
    transform: scale(0.95);
}

/* TOAST */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 10px;
    background: #333;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: toastIn .3s ease, toastOut .3s ease 2.5s forwards;
    pointer-events: auto;
    white-space: nowrap;
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* LOADING OVERLAY */
#loading {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.loading-box {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid var(--sep);
    border-top: 3px solid var(--ctrl-bg);
    border-radius: 50%;
    animation: loadSpin .8s linear infinite;
}

@keyframes loadSpin {
    to {
        transform: rotate(360deg);
    }
}

.loading-logo-wrap {
    margin-bottom: 16px;
}

.loading-logo-img {
    max-width: 200px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.loading-text {
    color: var(--text-muted);
    font-size: 15px;
}

/* CART BADGE BOUNCE */
#cart-count.bounce {
    animation: badgeBounce .4s ease;
}

@keyframes badgeBounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.4);
    }

    60% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* KEYBOARD HINT */
.keyboard-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    padding: 5px 14px;
    border-radius: 20px;
    pointer-events: none;
    transition: opacity .6s;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* CONFIRM MODAL */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn .2s ease;
}

.confirm-box {
    background: var(--flipbook-card-bg);
    border-radius: 14px;
    padding: 28px 32px 22px;
    width: 320px;
    max-width: 85vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: modalIn .25s ease;
}

.confirm-box h4 {
    color: var(--sidebar-text);
    font-size: 16px;
    margin-bottom: 8px;
}

.confirm-box p {
    color: #888;
    font-size: 13px;
    margin-bottom: 18px;
}

.confirm-box .confirm-actions {
    display: flex;
    gap: 10px;
}

.confirm-box .confirm-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
}

.confirm-box .confirm-actions .btn-yes {
    background: #e74c3c;
    color: #fff;
}

.confirm-box .confirm-actions .btn-yes:hover {
    background: #c0392b;
}

.confirm-box .confirm-actions .btn-no {
    background: rgba(128, 128, 128, 0.15);
    color: var(--sidebar-text);
}

.confirm-box .confirm-actions .btn-no:hover {
    background: rgba(128, 128, 128, 0.25);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* SIDEBAR OVERLAY (click outside) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

@media (max-width:768px) {
    .sidebar-overlay {
        background: rgba(0, 0, 0, 0.4);
    }
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 9999;
    transition: background .3s;
}

.overlay .close {
    position: fixed;
    top: 12px;
    right: 20px;
    color: #fff;
    font-size: 34px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
    opacity: .7;
    transition: opacity .2s;
    background: none;
    border: none;
    font-family: Arial, sans-serif;
}

.overlay .close:hover {
    opacity: 1;
}

#zoom-overlay {
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

#zoom-img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    cursor: default;
    border-radius: 4px;
    transition: transform .2s;
    transform-origin: center center;
}

#zoom-nav {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10000;
}

#zoom-nav button {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: Arial, sans-serif;
    transition: background .2s;
}

#zoom-nav button:hover {
    background: rgba(255, 255, 255, 0.25);
}

#zoom-level {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    z-index: 10000;
    font-family: Arial, sans-serif;
}

#thumbs-overlay {
    overflow-y: auto;
    padding: 60px 20px 30px;
    cursor: default;
}

#thumbs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

#thumbs-grid .thumb {
    width: 140px;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    transition: border-color .2s, transform .2s;
    flex-shrink: 0;
}

#thumbs-grid .thumb:hover {
    transform: scale(1.05);
}

#thumbs-grid .thumb.active {
    border-color: #4a90d9;
}

#thumbs-grid .thumb img {
    width: 100%;
    display: block;
    border-radius: 3px;
}

#thumbs-grid .thumb span {
    display: block;
    text-align: center;
    color: #aaa;
    font-size: 12px;
    padding: 4px 0;
    font-family: Arial, sans-serif;
}

@media (max-width:1140px) {
    #flipbook {
        width: 90vw;
        height: calc(90vw * 0.71);
    }
}

@media (max-width:768px) {
    body {
        padding: 28px 8px 70px;
        display: block;
        min-height: auto;
        overflow-x: hidden;
    }

    body.has-header {
        padding: 0;
    }

    #flipbook-container.has-header {
        margin-top: calc(var(--header-h, 60px) + 24px);
    }

    .catalog-header {
        padding: 0 10px;
    }

    .catalog-header .header-name {
        font-size: 14px;
    }

    .catalog-header .header-info {
        font-size: 11px;
    }

    .flipbook-card {
        padding: 14px 8px;
        border-radius: 10px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    #flipbook {
        width: 100%;
        height: auto;
        margin: 0 auto;
    }

    #flipbook .page-wrapper {
        border-radius: 10px;
    }

    #float-controls {
        bottom: 8px;
    }

    .fc-inner {
        padding: 5px 8px;
        border-radius: 40px;
        gap: 2px;
    }

    .fc-inner button {
        width: 30px;
        height: 30px;
        padding: 0;
        font-size: 14px;
        min-width: 30px;
    }

    #zoom-btn,
    #fullscreen-btn,
    #thumbs-btn,
    #autoplay-btn,
    #theme-btn,
    #share-btn,
    #download-btn {
        display: none;
    }

    #page-input {
        width: 30px;
        font-size: 11px;
        padding: 3px 2px;
    }

    #page-total {
        font-size: 11px;
    }

    .fc-sep {
        display: none;
    }

    #loading {
        padding: 15px;
        font-size: 14px;
    }

    #thumbs-grid .thumb {
        width: 80px;
    }

    .products-sidebar {
        width: 100%;
        max-width: 100vw;
    }

    #cart-toggle {
        top: 8px;
        right: 8px;
        width: 44px;
        height: 44px;
        padding: 0;
        z-index: 1002;
        border-radius: 50%;
    }

    body.has-header #cart-toggle {
        top: calc(8px + var(--header-h, 60px));
    }

    .cart-popup-overlay {
        align-items: flex-end;
    }

    .cart-popup {
        width: 100vw;
        max-width: 100vw;
        border-radius: 16px 16px 0 0;
        padding: 0;
        max-height: 80vh;
    }

    .cart-popup h3 {
        font-size: 15px;
    }

    .cart-popup .cp-item .cp-name {
        font-size: 12px;
    }

    .cart-popup .cp-item .cp-price {
        font-size: 13px;
    }

    .cart-popup .cp-actions {
        gap: 6px;
    }

    .cart-popup .cp-actions button {
        font-size: 12px;
        padding: 10px;
        min-width: 0;
    }

    #flipbook-container {
        width: 100%;
    }

    .social-bar {
        top: 4px;
        left: 4px;
    }

    .social-bar a {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .products-sidebar {
        padding-top: 56px;
        padding-bottom: env(safe-area-inset-bottom, 16px);
    }
}

@media (max-width:400px) {
    body {
        padding: 6px 6px 65px;
        overflow-x: hidden;
    }

    #flipbook {
        width: 100%;
        height: auto;
    }

    #flipbook .page-wrapper {
        border-radius: 6px;
    }

    .fc-inner button {
        padding: 4px 5px;
        font-size: 10px;
    }

    #page-input {
        width: 24px;
        font-size: 9px;
        padding: 2px;
    }

    #float-controls {
        bottom: 4px;
    }

    .fc-inner {
        padding: 4px 6px;
        gap: 1px;
    }
}

/* Landscape en teléfonos (altura < 600px): controles compactos, flipbook centrado */
@media (max-height:600px) and (orientation:landscape) {
    body {
        padding: 2px 2px 60px;
    }

    #float-controls {
        bottom: 4px;
    }

    #site-copyright {
        display: none;
    }

    .fc-inner {
        padding: 4px 8px;
        gap: 2px;
        border-radius: 30px;
    }

    .fc-inner button {
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 13px;
        flex-shrink: 0;
        min-width: 28px;
    }

    #zoom-btn,
    #fullscreen-btn,
    #thumbs-btn,
    #autoplay-btn,
    #theme-btn,
    #share-btn,
    #download-btn {
        display: none;
    }

    #page-input {
        width: 26px;
        font-size: 9px;
        padding: 2px;
    }

    #page-total {
        font-size: 9px;
    }

    .fc-sep {
        display: none;
    }

    #cart-toggle {
        top: 6px;
        right: 6px;
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 50%;
        z-index: 1002;
    }

    .products-sidebar {
        width: 260px;
        padding-top: 45px;
    }

    .cart-popup-overlay {
        align-items: flex-end;
    }

    .cart-popup {
        width: 100vw;
        max-width: 100vw;
        border-radius: 16px 16px 0 0;
        padding: 0;
        max-height: 78vh;
    }

    .social-bar {
        top: 3px;
        left: 3px;
    }

    .social-bar a {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* DOG EAR CORNER */
#flipbook .page-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.12) 52%, transparent 52%);
    pointer-events: none;
    z-index: 10;
}

/* FADE IN */
#flipbook-container {
    animation: fbFadeIn .5s ease;
}

@keyframes fbFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* STRIKETHROUGH PRICE */
.ci-price .old-price {
    text-decoration: line-through;
    color: #888;
    font-size: 11px;
    font-weight: normal;
    margin-right: 4px;
}

.ci-price .sale-price {
    color: #e74c3c;
}

.cp-price .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
    font-weight: normal;
    margin-right: 4px;
}

.cp-price .sale-price {
    color: #e74c3c;
}

/* CHECKOUT MODAL */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}

.checkout-box {
    background: var(--flipbook-card-bg);
    border-radius: 14px;
    padding: 28px 30px 22px;
    width: 360px;
    max-width: 88vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.checkout-box h4 {
    color: var(--sidebar-text);
    font-size: 17px;
    margin-bottom: 4px;
}

.checkout-box .co-sub {
    color: #888;
    font-size: 12px;
    margin-bottom: 16px;
}

.checkout-box label {
    display: block;
    text-align: left;
    color: var(--sidebar-text);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    margin-top: 10px;
}

.checkout-box label:first-of-type {
    margin-top: 0;
}

.checkout-box input,
.checkout-box textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--sidebar-text);
    outline: none;
    transition: border-color .2s;
    font-family: Arial, sans-serif;
}

.checkout-box input:focus,
.checkout-box textarea:focus {
    border-color: var(--ctrl-bg);
}

.checkout-box textarea {
    resize: vertical;
    min-height: 50px;
}

.checkout-box .co-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.checkout-box .co-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all .2s;
}

.checkout-box .co-actions .btn-co-ws {
    background: #25D366;
    color: #fff;
}

.checkout-box .co-actions .btn-co-ws:hover {
    background: #1ebe5e;
}

.checkout-box .co-actions .btn-co-cancel {
    background: rgba(128, 128, 128, 0.15);
    color: var(--sidebar-text);
}

.checkout-box .co-actions .btn-co-cancel:hover {
    background: rgba(128, 128, 128, 0.25);
}

.checkout-box .co-order {
    margin-top: 12px;
    background: rgba(128, 128, 128, 0.06);
    border-radius: 8px;
    padding: 10px;
    text-align: left;
    max-height: 120px;
    overflow-y: auto;
}

.checkout-box .co-order .co-item {
    font-size: 11px;
    color: #888;
    padding: 2px 0;
}

/* SEARCH IN SIDEBAR */
.cart-search {
    margin-bottom: 10px;
    position: relative;
}

.cart-search input {
    width: 100%;
    padding: 8px 10px 8px 30px;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    font-size: 12px;
    background: var(--sidebar-item-bg);
    color: var(--sidebar-text);
    outline: none;
}

.cart-search input:focus {
    border-color: var(--ctrl-bg);
}

.cart-search::before {
    content: '🔍';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
    opacity: 0.6;
}

/* QTY INPUT IN POPUP */
.cp-qty-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 8px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px;
}

.cp-qty-wrap button {
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    color: #475569;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s, color .15s;
}

.cp-qty-wrap button:hover {
    background: var(--fb-accent, #4f6ef7);
    color: #fff;
}

.cp-qty-wrap .cp-qty-val {
    font-size: 12px;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    color: #1e293b;
}

/* SHARE & DOWNLOAD in controls bar - inherit button styles */
/* ZOOM DRAG */
#zoom-img.dragging {
    cursor: grabbing;
}

/* CART ANIMATIONS */
#flipbook .page-wrapper .assets-layer>.asset.cart {
    opacity: 0;
}

#flipbook .page-wrapper .assets-layer>.asset.cart.ca-none {
    opacity: 1;
}

@keyframes cartFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes cartSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cartZoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cartBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3)
    }

    50% {
        transform: scale(1.08)
    }

    70% {
        transform: scale(0.95)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes cartFlipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }

    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

@keyframes cartFlipInY {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }

    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

.ca-fadeIn {
    animation-name: cartFadeIn;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

.ca-slideUp {
    animation-name: cartSlideUp;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

.ca-zoomIn {
    animation-name: cartZoomIn;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

.ca-bounceIn {
    animation-name: cartBounceIn;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

.ca-flipInX {
    animation-name: cartFlipInX;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

.ca-flipInY {
    animation-name: cartFlipInY;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

/* COOKIE BANNER */
.cookie-banner {
    position: fixed;
    left: 20px;
    bottom: 20px;
    right: auto;
    z-index: 999999;
    width: 340px;
    max-width: calc(100vw - 40px);
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    padding: 16px;
    animation: cookieUp .45s cubic-bezier(.22, 1, .36, 1);
}

.c-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.c-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(79, 110, 247, 0.18);
    color: #8ba0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

.c-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.c-title {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

.c-desc {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.45;
}

.c-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 14px;
}

.c-more {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s;
}

.c-more:hover {
    color: #cbd5e1;
    text-decoration: underline;
}

.c-btn {
    padding: 8px 22px;
    border-radius: 8px;
    border: none;
    background: var(--fb-accent, #4f6ef7);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.c-btn:hover {
    background: #3d5bd9;
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.4);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none;
    }
}

@keyframes cookieUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ── CART DISCOVERY HINT (globo "Ver productos" + anillo de pulso) ── */
.asset.cart.cart-interactive { position: relative; }
.asset.cart.cart-interactive::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 78%;
    height: 78%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: cart-pulse 2s ease-out infinite;
}
@keyframes cart-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(79, 110, 247, 0.45); }
    70%  { box-shadow: 0 0 0 14px rgba(79, 110, 247, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 110, 247, 0); }
}
.asset.cart .cart-btn { position: relative; z-index: 1; }
.cart-hint {
    position: absolute;
    left: 50%;
    bottom: 100%;
    margin-bottom: 9px;
    background: var(--fb-accent, #4f6ef7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 11px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(79, 110, 247, 0.4);
    pointer-events: none;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    animation: cart-hint-bob 1.8s ease-in-out infinite;
}
.cart-hint::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--fb-accent, #4f6ef7);
}
@keyframes cart-hint-bob {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, -5px); }
}
@media (prefers-reduced-motion: reduce) {
    .asset.cart.cart-interactive::before, .cart-hint { animation: none; }
}
