/* ==========================================================================
   ENGINEX SCRIPTS - CUSTOM TEBEX STORE CSS
   Contains variables and styles for glass-cards, product-cards, tilt elements,
   showroom modals, iframes, and documentation slide-over panel.
   ========================================================================== */

:root {
  /* Colors */
  --color-primary-h: 260;
  --color-primary-s: 70%;
  --color-primary-l: 55%;
  --color-primary: hsl(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l));
  --color-primary-rgb: 124, 58, 237; /* #7c3aed */

  --color-secondary-h: 184;
  --color-secondary-s: 100%;
  --color-secondary-l: 50%;
  --color-secondary: hsl(var(--color-secondary-h), var(--color-secondary-s), var(--color-secondary-l));
  --color-secondary-rgb: 0, 242, 255; /* #00f2ff */

  --color-success: #10b981;
  --color-success-rgb: 16, 185, 129;

  --color-text-muted: #9ca3af;
  --bg-card: rgba(10, 7, 20, 0.45);
  --border-glow: rgba(168, 85, 247, 0.15);
  --border-glow-hover: rgba(0, 242, 255, 0.3);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --glass-bg: rgba(10, 7, 20, 0.45);
  --glass-border: rgba(168, 85, 247, 0.15);
  --font-primary: 'Inter', system-ui, sans-serif;
  --font-heading: 'Outfit', system-ui, sans-serif;
}

/* Glassmorphism card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
    will-change: transform;
}

body:not(.is-scrolling) .glass-card:hover {
    border-color: var(--border-glow-hover);
    box-shadow: 0 12px 40px 0 rgba(var(--color-primary-rgb), 0.15);
    transform: translateY(-5px);
}

/* 3D Tilt Element */
.tilt-element {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-element > * {
    transform: translateZ(10px);
}

/* Product Card custom classes */
.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    will-change: transform;
}

.product-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--color-primary);
    color: #fff;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    z-index: 5;
}

.product-badge.premium {
    background: linear-gradient(135deg, var(--color-secondary), #0d9488);
}

.escrow-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(var(--color-success-rgb), 0.05);
    z-index: 5;
}

.product-image {
    height: 180px;
    background: radial-gradient(circle at center, rgba(var(--color-primary-rgb), 0.15), transparent 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.product-image i {
    font-size: 64px;
    color: var(--color-primary);
    filter: drop-shadow(0 0 15px rgba(var(--color-primary-rgb), 0.4));
    transition: var(--transition-smooth);
}

.product-image img {
    transition: var(--transition-smooth);
    will-change: transform;
}

.product-card:hover .product-image i {
    color: var(--color-secondary);
    filter: drop-shadow(0 0 20px rgba(var(--color-secondary-rgb), 0.6));
    transform: scale(1.1);
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-content h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
}

.product-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price-row .price {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

/* Product actions controls */
.product-actions {
    display: flex;
    gap: 12px;
}

.btn-demo-trigger {
    background: rgba(var(--color-primary-rgb), 0.12);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    color: var(--color-primary);
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    outline: none;
}

.btn-demo-trigger:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ==========================================================================
   MODAL DEMO SHOWROOM CSS
   ========================================================================== */

.demo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, visibility;
}

.demo-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 10, 0.90) !important;
    will-change: opacity;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.modal-wrapper {
    position: relative;
    width: 90%;
    max-width: 720px;
    z-index: 2005;
    opacity: 0;
    transform: scale(0.96) translate3d(0, 12px, 0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.demo-modal.active .modal-wrapper {
    transform: scale(1) translate3d(0, 0, 0);
    opacity: 1;
}

.modal-content {
    position: relative;
    padding: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #120e24 !important;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
}

.close-modal:hover {
    background: var(--color-primary);
    border-color: transparent;
    transform: rotate(90deg);
}

.modal-media-wrapper {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: #000;
}

.modal-media-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 32px;
    background: #0a0814;
    overflow-y: auto;
    flex: 1;
}

.modal-info h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-info p {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* YOUTUBE DEMO BUTTON STYLE */
.modal-video-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    display: none; /* Controlled by JavaScript */
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff0000, #c30000);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    color: #fff !important;
    cursor: pointer;
}

.modal-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
    background: linear-gradient(135deg, #ff1a1a, #d60000);
}

.modal-video-btn i {
    font-size: 16px;
    color: #fff;
}

.modal-video-btn.disabled {
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    color: rgba(255, 255, 255, 0.4) !important;
    transform: none !important;
}

.modal-video-btn.disabled i {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* ==========================================================================
   INTERACTIVE DOCUMENTATION PANEL STYLES (SPA OVERLAY)
   ========================================================================== */

.docs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 45px 24px 80px 24px;
    min-height: 100vh;
}

.docs-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 100px;
    z-index: 100;
}

.sidebar-menu {
    background: var(--bg-card);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gen-cat-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4px;
}

.gen-cat-btn div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gen-cat-btn i {
    font-size: 16px;
    transition: var(--transition-smooth);
}

.gen-cat-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.05);
}

.gen-cat-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(0, 242, 255, 0.05));
    border: 1px solid var(--border-glow);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.1);
}

.gen-cat-btn.active i {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.gen-cat-badge {
    font-size: 9px;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.gen-cat-btn.active .gen-cat-badge {
    background: rgba(168, 85, 247, 0.2);
    color: var(--color-primary);
}

.sidebar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 2px;
}

.sidebar-btn i {
    font-size: 14px;
    transition: var(--transition-smooth);
}

.sidebar-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.02);
}

.sidebar-btn.active {
    color: var(--color-secondary);
    background: rgba(0, 242, 255, 0.03);
    border-color: rgba(0, 242, 255, 0.15);
}

.sidebar-btn.active i {
    color: var(--color-secondary);
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.6);
}

.docs-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    min-height: 600px;
}

.docs-section {
    display: none;
}

.docs-section.active {
    display: block;
    animation: tabContentFadeIn 0.4s ease forwards;
}

.docs-section h2 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 12px;
}

.docs-section h2 span {
    color: var(--color-primary);
    text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.3);
}

.docs-section p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.docs-alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14.5px;
    line-height: 1.6;
}

.docs-alert.success {
    background: rgba(16, 185, 129, 0.08);
    border-left: 4px solid var(--color-success);
    color: #fff;
}

.docs-list {
    margin: 20px 0;
    padding-left: 20px;
    color: var(--color-text-muted);
    font-size: 14.5px;
    line-height: 1.7;
}

.docs-list li {
    margin-bottom: 10px;
}

.docs-list li strong {
    color: #fff;
}

.code-badge {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: var(--color-secondary);
}

.docs-table {
    border-collapse: collapse;
    width: 100%;
}

.docs-table th, .docs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: left;
}

.docs-table th {
    font-weight: 700;
    color: #fff;
    background: rgba(var(--color-primary-rgb), 0.1);
}

.docs-table td {
    color: var(--color-text-muted);
}

/* iframe loading skeleton */
#iframe-loader {
    transition: opacity 0.3s ease;
}

/* Mobile responsive docs */
@media (max-width: 960px) {
    .docs-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .docs-sidebar {
        position: static;
    }
}

/* ==========================================================================
   FORCE SYMMETRICAL ACTION BUTTONS (CACHE-PROOF OVERRIDES)
   ========================================================================== */
.product-content {
    padding: 25px !important; /* Asegura un margen interno uniforme y generoso en todos los lados */
}

.product-price-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: auto !important; /* Usamos auto para alinear los precios al fondo y evitar huecos fijos */
    padding-top: 15px !important; /* Pequeño espaciado encima de la línea divisoria */
    gap: 15px !important; /* Espacio de seguridad para evitar colisión de botones y precios */
}

.product-price-row .price {
    font-size: 20px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.1 !important;
}

.product-price-row .price .price-amount {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #00f2ff !important; /* Cian brillante */
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.2) !important;
    display: inline-block !important;
}

.product-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.product-actions .btn-demo-trigger,
.product-actions .btn-buy {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.product-actions .btn-demo-trigger i,
.product-actions .btn-buy i {
    font-size: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}

/* ==========================================================================
   CUSTOM CYBERPUNK TOOLTIPS (REPLACES VANILLA TITLE TOOLTIPS)
   ========================================================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #0d081b;
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 99999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(168, 85, 247, 0.2);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(168, 85, 247, 0.45) transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 99999;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ALINEAR EL TOOLTIP DE COMPRA A LA DERECHA PARA EVITAR CORTE POR OVERFLOW */
.product-actions .btn-buy::before {
    left: auto !important;
    right: 0 !important;
    transform: translateY(5px) !important;
}

.product-actions .btn-buy::after {
    left: auto !important;
    right: 16px !important; /* Centrado con el botón de 42px de ancho */
    transform: translateY(5px) !important;
}

.product-actions .btn-buy:hover::before,
.product-actions .btn-buy:hover::after {
    transform: translateY(0) !important;
}

