/*
 * RAMS Tablet Custom CSS
 * CDN-independent fallback styles for the tablet view.
 * All rules scoped to #rams-tablet-view to prevent cross-shell bleeding.
 * Version: 1.0.0
 */

/* ============================================================
   1. TABLET SHELL — Base Overrides
   ============================================================ */

#rams-tablet-view {
    font-family: 'Inter', sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

#rams-tablet-view body,
#rams-tablet-view #raw-body-wrapper {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
}

/* Fluid typography for tablet widths */
@media (min-width: 768px) and (max-width: 1023px) {
    #rams-tablet-view {
        font-size: clamp(0.875rem, 1.1vw, 1rem);
    }
}

/* ============================================================
   2. PRODUCT GRID — CDN-independent Fallbacks
   These replicate the unprefixed Tailwind classes used by
   shortcodes.php (rams_tablet_products / rams_get_tablet_card_html)
   ============================================================ */

/* Grid container: ensures 2-column layout WITHOUT Tailwind CDN */
#rams-tablet-view .rams-tablet-product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
}

#rams-tablet-view .product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Article card: flex layout fallback */
#rams-tablet-view .article-card {
    position: relative !important;
    display: flex !important;
    overflow: hidden !important;
    aspect-ratio: 500 / 610;
    padding: 0.125rem;
}

#rams-tablet-view .article-card.flex-row {
    flex-direction: row !important;
}

#rams-tablet-view .article-card.flex-row-reverse {
    flex-direction: row-reverse !important;
}

/* Card sidebar (25%) and image (75%) widths */
#rams-tablet-view .article-card > div:first-child,
#rams-tablet-view .article-card > .w-\[25\%\] {
    width: 25% !important;
    flex-shrink: 0 !important;
}

#rams-tablet-view .article-card > div:last-child,
#rams-tablet-view .article-card > .w-\[75\%\] {
    width: 75% !important;
    height: 100% !important;
    overflow: hidden !important;
    border-radius: 1.25rem !important;
}

/* Card image */
#rams-tablet-view .article-card img.rams-zoomable {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Static card (quote, historic, location) */
#rams-tablet-view .static-card {
    aspect-ratio: 500 / 610;
    display: flex !important;
    overflow: hidden !important;
    padding: 0.125rem;
}

/* Static card text — scaled down for 2-col tablet grid */
#rams-tablet-view .static-card p.font-montserrat,
#rams-tablet-view .static-card .font-montserrat.font-medium {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(0.75rem, 2.2vw, 1.4rem) !important;
    line-height: 1.3 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #000 !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

/* Static card CTA links (FAQs, Històric) */
#rams-tablet-view .static-card .font-montserrat.font-black {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(1.2rem, 5vw, 2.5rem) !important;
    font-weight: 900 !important;
    letter-spacing: 0.05em !important;
}

/* Static card divider line */
#rams-tablet-view .static-card .bg-black\/50 {
    width: 4rem !important;
    height: 0.15rem !important;
    background-color: rgba(0,0,0,0.5) !important;
}

/* ============================================================
   2b. CARD SIDEBAR — Arbitrary value fallbacks
   These replicate pt-[13.5rem], mt-[6.7rem], mt-[10.4rem] etc.
   that the Tailwind CDN generates at runtime.
   ============================================================ */

/* Sidebar container (25% strip with vertical layout) */
#rams-tablet-view .article-card > div:first-child {
    padding-top: clamp(2rem, 5vw, 5rem) !important;
    padding-bottom: clamp(0.75rem, 2vw, 1.5rem) !important;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: center !important;
    position: relative !important;
    height: 100% !important;
    flex-shrink: 0 !important;
    background-color: transparent !important;
    overflow: visible !important;
}

/* SKU text */
#rams-tablet-view .article-card h3 {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 900 !important;
    font-size: clamp(1.2rem, 3.5vw, 1.6rem) !important;
    color: #000 !important;
    letter-spacing: -0.05em !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    margin-top: 0 !important;
}

/* Title text (below SKU) */
#rams-tablet-view .article-card .line-clamp-3 {
    font-size: clamp(0.65rem, 1.8vw, 0.95rem) !important;
    color: #000 !important;
    font-weight: 700 !important;
    letter-spacing: 0.025em !important;
    line-height: 1.25 !important;
    padding-left: 0.125rem !important;
    padding-right: 0.125rem !important;
    margin-top: clamp(0.75rem, 2vw, 1.5rem) !important;
    min-height: 2.4rem !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    flex-shrink: 1 !important;
}

/* Icons container */
#rams-tablet-view .article-card .flex.flex-col.items-center.mt-\[10\.4rem\] {
    margin-top: clamp(0.75rem, 2vw, 1.5rem) !important;
    min-height: 0 !important;
    flex-shrink: 1 !important;
}

/* SVG icon wrapper */
#rams-tablet-view .article-card .relative.flex.items-center.justify-center.shrink-0 {
    width: clamp(3rem, 9vw, 5rem) !important;
    height: clamp(3rem, 9vw, 5rem) !important;
}

/* SVG elements — ensure currentColor works */
#rams-tablet-view .article-card svg {
    color: #000 !important;
    width: 100% !important;
    height: 100% !important;
}

/* SVG overlay text (the cm/value inside the icon) */
#rams-tablet-view .article-card .absolute.inset-0.flex span {
    font-size: clamp(1rem, 3vw, 1.4rem) !important;
    font-weight: 900 !important;
    color: #000 !important;
    font-family: 'Montserrat', sans-serif !important;
    letter-spacing: -0.025em !important;
}

/* Price container (bottom of sidebar) — ALWAYS visible */
#rams-tablet-view .article-card .items-baseline.font-montserrat {
    display: flex !important;
    align-items: baseline !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 900 !important;
    font-size: clamp(1.3rem, 4vw, 2.2rem) !important;
    color: #000 !important;
    letter-spacing: -0.05em !important;
    line-height: 1 !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

/* Euro symbol */
#rams-tablet-view .article-card .items-baseline.font-montserrat span {
    font-size: clamp(1.3rem, 4vw, 1.9rem) !important;
    margin-left: 0.125rem !important;
}

/* PROMO label fallback */
#rams-tablet-view .article-card .uppercase.tracking-\[0\.1em\] {
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
}

/* ============================================================
   3. UNPREFIXED TAILWIND UTILITY FALLBACKS
   Critical classes used in shortcodes.php that need CSS backup
   ============================================================ */

/* Display */
#rams-tablet-view .relative { position: relative !important; }
#rams-tablet-view .absolute { position: absolute !important; }
#rams-tablet-view .fixed { position: fixed !important; }
#rams-tablet-view .sticky { position: sticky !important; }

/* Flex */
#rams-tablet-view .flex { display: flex !important; }
#rams-tablet-view .inline-flex { display: inline-flex !important; }
#rams-tablet-view .grid { display: grid !important; }
#rams-tablet-view .block { display: block !important; }

/* Flex direction */
#rams-tablet-view .flex-row { flex-direction: row !important; }
#rams-tablet-view .flex-row-reverse { flex-direction: row-reverse !important; }
#rams-tablet-view .flex-col { flex-direction: column !important; }

/* Alignment */
#rams-tablet-view .items-center { align-items: center !important; }
#rams-tablet-view .items-start { align-items: flex-start !important; }
#rams-tablet-view .items-end { align-items: flex-end !important; }
#rams-tablet-view .items-baseline { align-items: baseline !important; }
#rams-tablet-view .justify-center { justify-content: center !important; }
#rams-tablet-view .justify-between { justify-content: space-between !important; }
#rams-tablet-view .justify-start { justify-content: flex-start !important; }

/* Sizing */
#rams-tablet-view .w-full { width: 100% !important; }
#rams-tablet-view .h-full { height: 100% !important; }
#rams-tablet-view .w-\[25\%\] { width: 25% !important; }
#rams-tablet-view .w-\[75\%\] { width: 75% !important; }
#rams-tablet-view .w-16 { width: 4rem !important; }

/* Shrink */
#rams-tablet-view .shrink-0 { flex-shrink: 0 !important; }

/* Spacing */
#rams-tablet-view .gap-x-\[0\.5rem\] { column-gap: 0.5rem !important; }
#rams-tablet-view .gap-y-\[0\.5rem\] { row-gap: 0.5rem !important; }
#rams-tablet-view .gap-\[0\.6rem\] { gap: 0.6rem !important; }

/* Insets */
#rams-tablet-view .inset-0 { inset: 0 !important; }
#rams-tablet-view .inset-y-0 { top: 0 !important; bottom: 0 !important; }

/* Overflow */
#rams-tablet-view .overflow-hidden { overflow: hidden !important; }
#rams-tablet-view .overflow-visible { overflow: visible !important; }

/* Grid columns */
#rams-tablet-view .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* Pointer events */
#rams-tablet-view .pointer-events-none { pointer-events: none !important; }
#rams-tablet-view .pointer-events-auto { pointer-events: auto !important; }

/* Z-index */
#rams-tablet-view .z-10 { z-index: 10 !important; }
#rams-tablet-view .z-20 { z-index: 20 !important; }

/* Border radius */
#rams-tablet-view .rounded-full { border-radius: 9999px !important; }
#rams-tablet-view .rounded-\[1\.25rem\] { border-radius: 1.25rem !important; }

/* Aspect ratio */
#rams-tablet-view .aspect-\[500\/610\] { aspect-ratio: 500 / 610 !important; }

/* Text utilities */
#rams-tablet-view .text-center { text-align: center !important; }
#rams-tablet-view .text-black { color: #000 !important; }
#rams-tablet-view .text-white { color: #fff !important; }
#rams-tablet-view .uppercase { text-transform: uppercase !important; }
#rams-tablet-view .whitespace-nowrap { white-space: nowrap !important; }
#rams-tablet-view .select-none { user-select: none; -webkit-user-select: none; }

/* Line clamp */
#rams-tablet-view .line-clamp-3 {
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
}

/* Font families */
#rams-tablet-view .font-montserrat,
#rams-tablet-view .font-\[\'Montserrat\'\],
#rams-tablet-view [class*="font-['Montserrat']"] {
    font-family: 'Montserrat', sans-serif !important;
}

/* Font weights */
#rams-tablet-view .font-bold { font-weight: 700 !important; }
#rams-tablet-view .font-black { font-weight: 900 !important; }
#rams-tablet-view .font-semibold { font-weight: 600 !important; }
#rams-tablet-view .font-medium { font-weight: 500 !important; }

/* Tracking */
#rams-tablet-view .tracking-tight { letter-spacing: -0.025em !important; }
#rams-tablet-view .tracking-tighter { letter-spacing: -0.05em !important; }
#rams-tablet-view .tracking-wide { letter-spacing: 0.025em !important; }
#rams-tablet-view .tracking-wider { letter-spacing: 0.05em !important; }
#rams-tablet-view .tracking-\[0\.05em\] { letter-spacing: 0.05em !important; }
#rams-tablet-view .tracking-\[0\.1em\] { letter-spacing: 0.1em !important; }

/* Leading */
#rams-tablet-view .leading-none { line-height: 1 !important; }
#rams-tablet-view .leading-tight { line-height: 1.25 !important; }
#rams-tablet-view .leading-\[1\.3\] { line-height: 1.3 !important; }
#rams-tablet-view .leading-\[1\.15\] { line-height: 1.15 !important; }

/* Padding */
#rams-tablet-view .p-\[0\.125rem\] { padding: 0.125rem !important; }
#rams-tablet-view .p-\[10\%\] { padding: 10% !important; }

/* Margin */
#rams-tablet-view .mt-\[25\%\] { margin-top: 25% !important; }
#rams-tablet-view .mt-0 { margin-top: 0 !important; }
#rams-tablet-view .mb-\[5\%\] { margin-bottom: 5% !important; }
#rams-tablet-view .my-\[2\.5rem\] { margin-top: 2.5rem; margin-bottom: 2.5rem; }
#rams-tablet-view .ml-\[0\.125rem\] { margin-left: 0.125rem !important; }

/* Background */
#rams-tablet-view .bg-transparent { background-color: transparent !important; }
#rams-tablet-view .bg-\[\#a5a4a3\] { background-color: #a5a4a3 !important; }
#rams-tablet-view .bg-black\/15 { background-color: rgba(0,0,0,0.15) !important; }
#rams-tablet-view .bg-\[\#a5a4a3\]\/80 { background-color: rgba(165,164,163,0.8) !important; }

/* Shadows */
#rams-tablet-view .shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1) !important; }
#rams-tablet-view .shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1) !important; }
#rams-tablet-view .shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1) !important; }

/* Rotation */
#rams-tablet-view .-rotate-90 { transform: rotate(-90deg) !important; }
#rams-tablet-view .-translate-x-1\/2 { transform: translateX(-50%) !important; }

/* Transition */
#rams-tablet-view .transition-all { transition: all 0.3s ease !important; }
#rams-tablet-view .duration-300 { transition-duration: 300ms !important; }

/* Cursor */
#rams-tablet-view .cursor-pointer { cursor: pointer !important; }

/* Object fit */
#rams-tablet-view .object-cover { object-fit: cover !important; }
#rams-tablet-view .object-contain { object-fit: contain !important; }

/* ============================================================
   4. HEADER — Tablet-specific
   ============================================================ */

#rams-tablet-view .t-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    width: 100% !important;
    background: rgba(255,255,255,0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 1.5rem 2rem 1.5rem 4rem !important;
}

#rams-tablet-view .logo-container-tablet {
    width: 14rem !important;
    height: 14rem !important;
    min-width: 14rem !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ============================================================
   5. BOTTOM NAV — Tablet-specific
   ============================================================ */

#rams-tablet-view #tablet-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 5.5rem !important;
    background: rgba(0,0,0,0.4) !important;
    border-top: 1px solid rgba(212,175,55,0.3) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 50 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3rem !important;
    padding: 0 2rem !important;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3) !important;
    border-top-left-radius: 1.375rem !important;
    border-top-right-radius: 1.375rem !important;
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1) !important;
    will-change: transform !important;
}

#rams-tablet-view #tablet-bottom-nav a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 48px !important;
    min-height: 48px !important;
    width: 4.25rem !important;
    height: 4.25rem !important;
    border-radius: 9999px !important;
    padding: 0.5rem !important;
}

#rams-tablet-view #tablet-bottom-nav img {
    width: 3.5rem !important;
    height: 3.5rem !important;
    object-fit: contain !important;
}

/* Hide mobile nav on tablet, hide tablet nav on mobile */
@media (min-width: 768px) and (max-width: 1023px) {
    #mobile-bottom-nav { display: none !important; }
}
@media (max-width: 767px) {
    #tablet-bottom-nav { display: none !important; }
}

/* ============================================================
   6. CHAT BUBBLE — Tablet Animation
   ============================================================ */

#rams-tablet-view #rams-chat-bubble {
    display: block !important;
    position: fixed !important;
    bottom: 5.6rem !important;
    left: 50% !important;
    margin-left: 13.5rem !important;
    height: 200px !important;
    width: auto !important;
    z-index: 999999 !important;
    cursor: pointer !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-50%) scale(0) !important;
    pointer-events: none !important;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.15));
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.6s ease,
                visibility 0.6s !important;
}

#rams-tablet-view #rams-chat-bubble.bubble-animate {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) scale(1) !important;
    pointer-events: auto !important;
}

/* ============================================================
   7. FOOTER — Tablet-specific
   ============================================================ */

#rams-tablet-view footer {
    width: 100% !important;
    position: relative !important;
    z-index: 20 !important;
}

#rams-tablet-view .logo-glow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15),
                0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   8. WORDPRESS / ELEMENTOR Overrides
   ============================================================ */

#rams-tablet-view .entry-title,
#rams-tablet-view .entry-header,
#rams-tablet-view .page-header,
#rams-tablet-view .wp-block-post-title {
    display: none !important;
}

/* Scrollbar hiding within tablet shell */
#rams-tablet-view {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#rams-tablet-view::-webkit-scrollbar { display: none; }

/* ============================================================
   9. LOAD MORE BUTTON
   ============================================================ */

#rams-tablet-view #rams-load-more-tablet {
    background-color: #d5d5d5;
    color: #000;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1.2rem 5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#rams-tablet-view #rams-load-more-tablet:hover,
#rams-tablet-view #rams-load-more-tablet:active,
#rams-tablet-view #rams-load-more-tablet:focus {
    background-color: #000 !important;
    color: #fff !important;
}

#rams-tablet-view #rams-load-more-tablet:active {
    transform: scale(0.95);
}

/* Loading state (JS adds opacity-70) */
#rams-tablet-view #rams-load-more-tablet.opacity-70 {
    opacity: 0.7 !important;
}

#rams-tablet-view #rams-load-more-tablet.cursor-not-allowed {
    cursor: not-allowed !important;
}