/* soulTungsten Mobile-First CSS */
/* Designed for optimal mobile experience */

/* CSS Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #0a0a0a;
    --dark: #1a1a1a;
    --gray: #2a2a2a;
    --light-gray: #999;
    --white: #f0f0f0;
    --accent: #d0d0d0;
    
    /* Mobile-optimized spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Safe area for notched phones */
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    
    /* Bottom nav height */
    --bottom-nav-height: 60px;
}

/* Base Styles */
html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', sans-serif;
    background-color: var(--black);
    color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    color: var(--accent);
    font-weight: 300;
}

/* Mobile Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid var(--gray);
    padding-top: var(--safe-area-top);
}

.header-content {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.search-toggle,
.header-cart {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--white);
    position: relative;
}

.cart-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #00aaff;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.cart-count[data-count="0"] {
    display: none;
}

/* Hero Section */
.hero-mobile {
    margin-top: calc(56px + var(--safe-area-top));
    padding: var(--space-xl) var(--space-md);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-visual {
    width: 200px;
    height: 200px;
    margin-bottom: var(--space-xl);
    position: relative;
}

.cube-showcase {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cube-3d {
    width: 120px;
    height: 120px;
    background: linear-gradient(145deg, #2a2a2a, #0a0a0a);
    position: relative;
    transform: rotateX(-20deg) rotateY(45deg);
    transform-style: preserve-3d;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.cube-3d::before,
.cube-3d::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a1a1a, #0a0a0a);
}

.cube-3d::before {
    transform: rotateY(90deg) translateZ(60px);
}

.cube-3d::after {
    transform: rotateX(90deg) translateZ(60px);
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.1; }
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, #ffffff, #808080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: var(--space-xl);
    padding: 0 var(--space-lg);
}

.cta-button {
    display: inline-block;
    padding: 14px 32px;
    background: var(--white);
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:active {
    transform: scale(0.98);
}

/* Trust Bar */
.trust-bar {
    display: flex;
    justify-content: space-around;
    padding: var(--space-lg) var(--space-md);
    background: var(--dark);
    border-top: 1px solid var(--gray);
    border-bottom: 1px solid var(--gray);
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.875rem;
    color: var(--light-gray);
}

.trust-item svg {
    opacity: 0.7;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header h3 {
    margin-bottom: var(--space-xs);
}

.section-header p {
    font-size: 0.875rem;
}

/* Featured Product */
.featured-product {
    padding: var(--space-xl) var(--space-md);
}

.product-card-mobile {
    background: var(--dark);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--gray);
}

.product-card-mobile.featured {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.product-image {
    position: relative;
    height: 200px;
    background: #111;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: #00aaff;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-badge.limited {
    background: #ff6b6b;
}

.product-info {
    padding: var(--space-lg);
}

.product-info h4 {
    margin-bottom: var(--space-xs);
}

.product-weight {
    font-size: 0.875rem;
    color: var(--light-gray);
    margin-bottom: var(--space-sm);
}

.product-description {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--space-lg);
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price {
    font-size: 1.5rem;
    font-weight: 600;
}

.add-to-cart-quick {
    padding: 10px 20px;
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.2s;
}

.add-to-cart-quick:active {
    transform: scale(0.95);
}

.view-details {
    padding: 8px 16px;
    background: var(--gray);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Products Grid */
.products-section {
    padding: var(--space-xl) var(--space-md);
    background: var(--black);
}

.products-grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.products-grid-mobile .product-card-mobile {
    height: 100%;
}

.products-grid-mobile .product-image {
    height: 140px;
}

.products-grid-mobile .product-info {
    padding: var(--space-md);
}

.products-grid-mobile .product-info h4 {
    font-size: 0.9rem;
}

.products-grid-mobile .price {
    font-size: 1.1rem;
}

.section-footer {
    text-align: center;
}

.secondary-cta {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Element Info */
.element-info {
    padding: var(--space-xl) var(--space-md);
    background: var(--dark);
}

.element-card-mobile {
    background: var(--black);
    border: 1px solid var(--gray);
    border-radius: 12px;
    padding: var(--space-xl);
    text-align: center;
}

.element-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.atomic-number {
    font-size: 1.5rem;
    color: var(--light-gray);
}

.element-symbol {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
}

.element-name {
    font-size: 1.1rem;
}

.element-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.fact {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.fact-label {
    font-size: 0.75rem;
    color: var(--light-gray);
}

.fact-value {
    font-size: 0.875rem;
    font-weight: 600;
}

/* About Section */
.about-section {
    padding: var(--space-xl) var(--space-md);
    background: var(--black);
}

.section-content {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.section-content h3 {
    margin-bottom: var(--space-lg);
}

.section-content p {
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.text-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--gray);
    display: flex;
    align-items: flex-start;
    padding-bottom: var(--safe-area-bottom);
    z-index: 99;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: var(--bottom-nav-height);
    text-decoration: none;
    color: var(--light-gray);
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--white);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.75rem;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--black);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.mobile-menu.active {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-md);
    padding-top: calc(var(--space-lg) + var(--safe-area-top));
    border-bottom: 1px solid var(--gray);
}

.menu-header h2 {
    font-size: 1.5rem;
}

.menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--white);
}

.menu-nav {
    padding: var(--space-xl) 0;
}

.menu-nav a {
    display: block;
    padding: var(--space-lg) var(--space-xl);
    color: var(--white);
    text-decoration: none;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--gray);
    transition: background-color 0.2s;
}

.menu-nav a:active {
    background-color: var(--dark);
}

.menu-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-count-menu {
    background: #00aaff;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.menu-footer {
    position: absolute;
    bottom: calc(var(--space-xl) + var(--safe-area-bottom));
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    padding: 0 var(--space-xl);
}

.menu-footer a {
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.875rem;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--gray);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    z-index: 300;
}

.cart-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--dark) 25%, var(--gray) 50%, var(--dark) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Design - Larger Phones */
@media (min-width: 375px) {
    .products-grid-mobile {
        gap: var(--space-lg);
    }
    
    .hero-content h2 {
        font-size: 2.25rem;
    }
}

/* Tablets and Desktop */
@media (min-width: 768px) {
    /* Hide mobile elements */
    .bottom-nav,
    .mobile-menu {
        display: none;
    }
    
    /* Adjust header for desktop */
    .mobile-header {
        height: 70px;
        padding: 0 5%;
    }
    
    .header-content {
        height: 70px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    /* Add desktop navigation */
    .header-content::after {
        content: '';
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: var(--space-xl);
    }
    
    /* Adjust hero for larger screens */
    .hero-mobile {
        margin-top: calc(70px + var(--safe-area-top));
        min-height: 600px;
        padding: var(--space-xl) 5%;
    }
    
    .hero-visual {
        width: 300px;
        height: 300px;
    }
    
    .cube-3d {
        width: 180px;
        height: 180px;
    }
    
    .cube-3d::before {
        transform: rotateY(90deg) translateZ(90px);
    }
    
    .cube-3d::after {
        transform: rotateX(90deg) translateZ(90px);
    }
    
    .hero-content h2 {
        font-size: 3rem;
    }
    
    .hero-content p {
        font-size: 1.125rem;
        max-width: 600px;
        margin: 0 auto var(--space-xl);
    }
    
    /* Products grid for tablets */
    .products-grid-mobile {
        grid-template-columns: repeat(3, 1fr);
        max-width: 900px;
        margin: 0 auto var(--space-xl);
    }
    
    /* Sections */
    .featured-product,
    .products-section,
    .element-info,
    .about-section {
        padding: 60px 5%;
    }
    
    .section-content {
        max-width: 700px;
    }
    
    /* Remove bottom padding from body */
    body {
        padding-bottom: 0;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .products-grid-mobile {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
    
    .featured-product .product-card-mobile {
        display: grid;
        grid-template-columns: 1fr 1fr;
        max-width: 900px;
        margin: 0 auto;
    }
    
    .featured-product .product-image {
        height: 400px;
    }
    
    .featured-product .product-info {
        padding: var(--space-xl);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .featured-product .product-description {
        font-size: 1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Dark mode is default, but respect light mode preference */
@media (prefers-color-scheme: light) {
    /* You could add light mode styles here if desired */
}

/* Touch-friendly tap targets */
button, a {
    min-height: 44px;
    min-width: 44px;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .mobile-header,
    .bottom-nav,
    .mobile-menu {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}