/**
 * MhSys OS - E-commerce Product Detail Page (PDP) Modern Modular Stylesheet
 * File: /public/css/pages/ecommerce_product_detail.css
 * 
 * Features:
 * - Fluid Responsive Title Typography (no text-truncate cuts)
 * - Executive Discreet Section Subtitles
 * - Modern Bento-Grid & Modular Attributes Cards
 * - Advanced Interactive Sharing Hub & Dynamic QR Code Modal
 * - Glassmorphic Surfaces, Shimmer CTA Buttons & Layered Volumetric Shadows
 * - Full Dark/Light Theme Compatibility & iOS Mobile Optimization
 */

/* ==========================================================================
   1. TIPOGRAFIA RESPONSIVA DO PRODUTO & INTERTÍTULOS DISCRETOS
   ========================================================================== */

.pdp-product-title-highlight {
    font-size: clamp(1.35rem, 3.8vw, 1.85rem) !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    color: var(--text-main, #0f172a) !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 0.75rem !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    text-overflow: clip !important;
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    max-height: none !important;
    transition: color 0.2s ease;
}

/* Bloco de Título Mobile Destacado no Topo */
.pdp-mobile-title-block {
    background: transparent;
    padding: 0.15rem 0 0.5rem 0;
}

.pdp-product-title-mobile {
    font-size: clamp(1.4rem, 5.2vw, 1.85rem) !important;
    line-height: 1.22 !important;
    font-weight: 800 !important;
    color: var(--text-main, #0f172a) !important;
    margin-bottom: 0.45rem !important;
    letter-spacing: -0.025em !important;
}

body.dark-theme .pdp-product-title-highlight,
body.dark-theme .pdp-product-title-mobile {
    color: #f8fafc !important;
}

/* Rótulo e Intertítulo Suave e Elegante para Descrições e Seções */
.pdp-section-label-discreet {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem !important;
    font-family: var(--font-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    padding: 0.25rem 0;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    width: 100%;
}

body.dark-theme .pdp-section-label-discreet {
    color: #94a3b8;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.pdp-section-label-discreet i {
    font-size: 0.85rem;
    color: var(--primary, #3b82f6);
    opacity: 0.85;
}

/* ==========================================================================
   2. FICHA TÉCNICA EM BENTO-GRID & CARDS MODULARES
   ========================================================================== */

.pdp-attributes-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-attributes-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 576px) {
    .product-attributes-bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

.pdp-attr-card {
    background: var(--bg-card-subtle, #f8fafc);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease,
                background-color 0.25s ease;
}

.pdp-attr-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb, 59, 130, 246), 0.4);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    background: #ffffff;
}

body.dark-theme .pdp-attr-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .pdp-attr-card:hover {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(var(--primary-rgb, 59, 130, 246), 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pdp-attr-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pdp-attr-icon-badge {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.1);
    color: var(--primary, #3b82f6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

body.dark-theme .pdp-attr-icon-badge {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.2);
    color: #93c5fd;
}

.pdp-attr-label {
    font-size: 0.68rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-theme .pdp-attr-label {
    color: #94a3b8;
}

.pdp-attr-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    line-height: 1.3;
    word-break: break-word;
    margin-left: 0.1rem;
}

body.dark-theme .pdp-attr-value {
    color: #f1f5f9;
}

/* Expansão com Transição Suave para mais de 6 atributos */
.pdp-attrs-collapse-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.pdp-attrs-collapse-container.expanded {
    max-height: 2000px;
    opacity: 1;
    margin-top: 0.75rem;
}

.btn-expand-attrs {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 0.45rem 1.15rem !important;
    border-radius: 999px !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    background: #ffffff !important;
    color: var(--text-main, #334155) !important;
}

.btn-expand-attrs:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: var(--primary, #3b82f6) !important;
}

body.dark-theme .btn-expand-attrs {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

body.dark-theme .btn-expand-attrs:hover {
    background: rgba(51, 65, 85, 0.9) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   3. CENTRAL AVANÇADA DE COMPARTILHAMENTO & MODAL QR CODE
   ========================================================================== */

.pdp-share-card {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.03);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 18px;
    padding: 1.1rem;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s ease;
}

body.dark-theme .pdp-share-card {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.08);
}

.pdp-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.pdp-share-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #64748b);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-pdp-native-share {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--primary, #3b82f6);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 59, 130, 246), 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-pdp-native-share:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 59, 130, 246), 0.4);
    filter: brightness(1.05);
}

.btn-pdp-native-share:active {
    transform: scale(0.96);
}

.pdp-share-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-pdp-share-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #ffffff;
    color: var(--text-main, #1e293b);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 38px;
}

body.dark-theme .btn-pdp-share-pill {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.btn-pdp-share-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-pdp-share-pill:active {
    transform: scale(0.96);
}

/* Variações Específicas dos Botões */
.btn-share-whatsapp {
    background: rgba(37, 211, 102, 0.08);
    border-color: rgba(37, 211, 102, 0.3);
    color: #128c7e;
}
.btn-share-whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: #ffffff;
}

.btn-share-copy {
    background: rgba(100, 116, 139, 0.06);
    border-color: rgba(100, 116, 139, 0.25);
    color: #475569;
}
body.dark-theme .btn-share-copy {
    color: #cbd5e1;
}
.btn-share-copy.copied {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

.btn-share-qrcode {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.25);
    color: #7c3aed;
}
.btn-share-qrcode:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #ffffff;
}

.btn-share-pdf {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
    border-color: rgba(var(--primary-rgb, 59, 130, 246), 0.3);
    color: var(--primary, #3b82f6);
}
.btn-share-pdf:hover {
    background: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
    color: #ffffff;
}

/* Modal QR Code Visual Premium */
.pdp-qrcode-modal-content {
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.pdp-qrcode-wrapper {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
    margin: 1rem auto;
}

.pdp-qrcode-wrapper canvas,
.pdp-qrcode-wrapper svg {
    max-width: 220px;
    height: auto;
    display: block;
}

/* ==========================================================================
   4. MICROINTERAÇÕES, BOTÕES SHIMMER & TOUCH SAFEGUARDS
   ========================================================================== */

/* Shimmer Reflexivo no Hover em Botões de Ação Principal */
.btn-shimmer {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(25deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.btn-shimmer:hover {
    transform: scale(1.02);
}

.btn-shimmer:hover::after {
    opacity: 1;
    animation: pdpShimmerEffect 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

@keyframes pdpShimmerEffect {
    0% {
        left: -60%;
    }
    100% {
        left: 140%;
    }
}

/* Blindagem Anti-Zoom Safari iOS & Touch Targets */
input, select, textarea {
    font-size: 16px !important; /* Previne auto-zoom no Safari iOS */
}

.btn, button, .thumbnail-btn, .gallery-nav-btn {
    min-height: 44px;
    min-width: 44px;
}

/* ==========================================================================
   5. ACESSIBILIDADE & PARSERS DE IA (AEO / GEO / LLM-FRIENDLY)
   ========================================================================== */

/* Esconde visualmente de usuários humanos, mas mantém 100% legível por spiders de IA e leitores de tela */
.visually-hidden-llm {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
