/**
 * Minimal Theme - Unified Design System
 * Clean, white background with bold typography
 */

/** 
 * Add these CSS variables to your :root section in minimal-theme.css
 * Add them after the existing variables
 */

:root {
    --minimal-bg: #ffffff;
    --minimal-text: #000000;
    --minimal-text-light: #666666;
    --minimal-text-muted: #999999;
    --minimal-accent: #000000;
    --minimal-border: #e5e5e5;
    --minimal-hover: #f5f5f5;
    
    /* ADD THESE NEW VARIABLES */
    --minimal-background: #ffffff; /* For compatibility */
    --minimal-text-rgb: 0, 0, 0; /* For rgba calculations */
    --minimal-border-color: #e5e5e5; /* For compatibility */
    --minimal-hover-color: #f5f5f5; /* For compatibility */
}

/* Prevent horizontal scrolling globally */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

body, body.minimal-theme {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    background: var(--minimal-bg);
    color: var(--minimal-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Remove default link styling from related product cards */
.related-product-card,
.related-product-card h1,
.related-product-card h2,
.related-product-card h3,
.related-product-card h4,
.related-product-card h5,
.related-product-card h6,
.related-product-card p,
.related-product-card div,
.related-product-card span {
    text-decoration: none !important;
    color: var(--minimal-text) !important;
}

/* Typography */
.minimal-title {
    font-size: 64px;
    font-weight: 700;
    color: var(--minimal-text);
    margin: 0 0 16px 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.minimal-subtitle {
    font-size: 20px;
    font-weight: 400;
    color: var(--minimal-text);
    margin: 0;
    line-height: 1.4;
}

.minimal-heading {
    font-size: 32px;
    font-weight: 700;
    color: var(--minimal-text);
    margin: 0 0 16px 0;
    letter-spacing: -0.01em;
}

.minimal-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--minimal-text);
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

/* Navigation */
.minimal-nav {
    background: var(--minimal-bg);
    border-bottom: 2px solid var(--minimal-text);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.minimal-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.minimal-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--minimal-text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.minimal-nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.minimal-nav-link {
    font-size: 16px;
    font-weight: 500;
    color: var(--minimal-text);
    text-decoration: none;
    transition: opacity 0.2s;
}

.minimal-nav-link:hover {
    opacity: 0.6;
}

.minimal-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--minimal-text);
    background: transparent;
    border: 2px solid var(--minimal-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.minimal-button:hover {
    background: var(--minimal-text);
    color: var(--minimal-bg);
}

.minimal-button-primary {
    background: var(--minimal-text);
    color: var(--minimal-bg);
}

.minimal-button-primary:hover {
    background: transparent;
    color: var(--minimal-text);
}

/* Container */
.minimal-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.minimal-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Cards */
.minimal-card {
    background: white;
    border: 2px solid var(--minimal-border);
    padding: 32px;
    margin-bottom: 32px;
    transition: border-color 0.2s;
}

.minimal-card:hover {
    border-color: var(--minimal-text);
}

.minimal-card-compact {
    padding: 24px;
    margin-bottom: 24px;
}

/* Lists */
.minimal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.minimal-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--minimal-border);
}

/* Forms */
.minimal-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--minimal-border);
    background: var(--minimal-bg);
    color: var(--minimal-text);
    transition: border-color 0.2s;
}

.minimal-input:focus {
    outline: none;
    border-color: var(--minimal-text);
}

.minimal-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--minimal-text);
}

/* Abstract Graphic */
.minimal-graphic {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 1135px;
    height: 893px;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: graphicFloat 20s ease-in-out infinite;
    filter: blur(0.5px);
}

.minimal-graphic svg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.minimal-graphic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 70% 30%, rgba(var(--minimal-text-rgb, 0, 0, 0), 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.minimal-graphic::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(var(--minimal-text-rgb, 0, 0, 0), 0.05) 100%);
    pointer-events: none;
    z-index: 2;
}

@keyframes graphicFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(-10px, -15px) rotate(1deg);
    }
    66% {
        transform: translate(10px, -10px) rotate(-1deg);
    }
}

.minimal-graphic:hover {
    opacity: 0.15;
    transform: scale(1.02);
}

/* Grid */
.minimal-grid {
    display: grid;
    gap: 32px;
    width: 100%;
    max-width: 100%;
}

.minimal-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.minimal-grid > * {
    min-width: 0;
    max-width: 100%;
}

/* Featured Article Cards */
.featured-article-card {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 100%;
    max-width: 100%;
}

.featured-article-title,
.featured-article-title a,
.featured-article-title span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    display: block;
}

.featured-article-title a {
    width: 100%;
    max-width: 100%;
}

.featured-article-title span {
    display: inline-block;
    max-width: 100%;
}

.featured-article-excerpt {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    width: 100%;
}

.minimal-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.minimal-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Related Products Section */
.related-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Tablet: 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Related Product Card - Force black text, no underline */
a.related-product-card,
a.related-product-card:link,
a.related-product-card:visited,
a.related-product-card:hover,
a.related-product-card:active,
a.related-product-card:focus {
    padding: 24px;
    display: block;
    text-decoration: none !important;
    color: #000000 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid var(--minimal-border);
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

a.related-product-card *,
a.related-product-card *:link,
a.related-product-card *:visited,
a.related-product-card *:hover,
a.related-product-card *:active,
a.related-product-card *:focus {
    color: #000000 !important;
    text-decoration: none !important;
}

/* Override for button - ensure white text on black background */
a.related-product-card .related-product-button,
a.related-product-card .related-product-button *,
a.related-product-card .related-product-button *:link,
a.related-product-card .related-product-button *:visited,
a.related-product-card .related-product-button *:hover,
a.related-product-card .related-product-button *:active,
a.related-product-card .related-product-button *:focus {
    color: #ffffff !important;
}

a.related-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #000000;
    text-decoration: none !important;
    color: #000000 !important;
}

a.related-product-card:hover *,
a.related-product-card:hover *:link,
a.related-product-card:hover *:visited,
a.related-product-card:hover *:hover,
a.related-product-card:hover *:active,
a.related-product-card:hover *:focus {
    color: #000000 !important;
    text-decoration: none !important;
}

/* Override for button on hover - black text on white background */
a.related-product-card:hover .related-product-button,
a.related-product-card:hover .related-product-button *,
a.related-product-card:hover .related-product-button *:link,
a.related-product-card:hover .related-product-button *:visited,
a.related-product-card:hover .related-product-button *:hover,
a.related-product-card:hover .related-product-button *:active,
a.related-product-card:hover .related-product-button *:focus {
    color: #000000 !important;
}

.related-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: 1px solid var(--minimal-border);
    margin-bottom: 16px;
}

.related-product-brand {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--minimal-text-muted) !important;
    margin-bottom: 8px;
}

.related-product-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #000000 !important;
    text-decoration: none !important;
}

.related-product-price {
    margin-bottom: 16px;
}

.related-product-price-value {
    font-size: 24px;
    font-weight: 700;
    color: #000000 !important;
    text-decoration: none !important;
}

.related-product-button {
    width: 100%;
    text-align: center;
    font-size: 14px;
    padding: 12px 24px;
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    text-decoration: none !important;
    display: block !important;
}

/* Force white text on button - override any parent color rules */
a.related-product-card .related-product-button,
a.related-product-card .related-product-button *,
.related-product-button,
.related-product-button * {
    color: #ffffff !important;
}

.related-product-card:hover .related-product-button {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* Force black text on button hover - override any parent color rules */
a.related-product-card:hover .related-product-button,
a.related-product-card:hover .related-product-button *,
.related-product-card:hover .related-product-button,
.related-product-card:hover .related-product-button * {
    color: #000000 !important;
}

/* Responsive grid: 3 columns on desktop/tablet, 1 column on mobile */
/* This class is standalone and doesn't require minimal-grid-2 */
.minimal-grid-responsive {
    /* Desktop/Tablet: Use 3 columns */
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .minimal-grid-responsive {
        /* Mobile: Use 1 column */
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .minimal-grid-responsive {
        /* Small mobile: Still 1 column */
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Text Utilities */
.minimal-text-primary { color: var(--minimal-text); }
.minimal-text-light { color: var(--minimal-text-light); }
.minimal-text-muted { color: var(--minimal-text-muted); }

/* Spacing */
.minimal-mt-0 { margin-top: 0; }
.minimal-mb-0 { margin-bottom: 0; }
.minimal-mb-4 { margin-bottom: 24px; }
.minimal-mb-8 { margin-bottom: 48px; }

/* Additional overflow protection for all containers */
.minimal-card,
.minimal-grid,
.minimal-form-group,
img,
video,
iframe,
table {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Ensure flex containers don't overflow */
[class*="flex"],
[style*="display: flex"] {
    min-width: 0;
    max-width: 100%;
}

/* Prevent wide tables from causing overflow */
table {
    width: 100%;
    table-layout: auto;
}

/* Ensure images scale properly */
img {
    height: auto;
    object-fit: contain;
}

/* Responsive */
@media (max-width: 768px) {
    .minimal-title {
        font-size: 48px;
    }
    
    .minimal-subtitle {
        font-size: 18px;
    }
    
    .minimal-container {
        padding: 40px 20px;
    }
    
    .minimal-content {
        padding: 0;
    }
    
    .minimal-card {
        padding: 20px;
    }
    
    .minimal-grid {
        gap: 20px;
    }
    
    .minimal-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .minimal-grid-3 {
        grid-template-columns: 1fr;
    }
    
    /* Related Products - Mobile Responsive */
    .related-products-section {
        margin-top: 40px !important;
        padding-top: 32px !important;
    }
    
    .related-products-title {
        font-size: 28px !important;
        margin-bottom: 12px !important;
    }
    
    .related-products-subtitle {
        font-size: 14px !important;
        margin-bottom: 24px !important;
    }
    
    .related-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Mobile: Force black text, no underline on related product cards */
    a.related-product-card,
    a.related-product-card:link,
    a.related-product-card:visited,
    a.related-product-card:hover,
    a.related-product-card:active,
    a.related-product-card:focus {
        padding: 20px !important;
        text-decoration: none !important;
        color: #000000 !important;
        -webkit-tap-highlight-color: transparent;
    }
    
    a.related-product-card *,
    a.related-product-card *:link,
    a.related-product-card *:visited,
    a.related-product-card *:hover,
    a.related-product-card *:active,
    a.related-product-card *:focus {
        color: #000000 !important;
        text-decoration: none !important;
    }
    
    a.related-product-card:hover {
        text-decoration: none !important;
        color: #000000 !important;
    }
    
    a.related-product-card:hover *,
    a.related-product-card:hover *:link,
    a.related-product-card:hover *:visited,
    a.related-product-card:hover *:hover,
    a.related-product-card:hover *:active,
    a.related-product-card:hover *:focus {
        color: #000000 !important;
        text-decoration: none !important;
    }
    
    /* Override for button on hover on mobile - black text on white background */
    a.related-product-card:hover .related-product-button,
    a.related-product-card:hover .related-product-button * {
        color: #000000 !important;
    }
    
    .related-product-image {
        height: 180px !important;
        margin-bottom: 12px !important;
    }
    
    .related-product-brand {
        font-size: 11px !important;
        margin-bottom: 6px !important;
        color: var(--minimal-text-muted) !important;
        text-decoration: none !important;
    }
    
    .related-product-title {
        font-size: 18px !important;
        margin-bottom: 10px !important;
        color: #000000 !important;
        text-decoration: none !important;
    }
    
    .related-product-price-value {
        font-size: 20px !important;
        color: #000000 !important;
        text-decoration: none !important;
    }
    
    .related-product-button {
        font-size: 13px !important;
        padding: 10px 20px !important;
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #000000 !important;
        text-decoration: none !important;
    }
    
    /* Force white text on button on mobile - override any parent color rules */
    a.related-product-card .related-product-button,
    a.related-product-card .related-product-button *,
    a.related-product-card .related-product-button *:link,
    a.related-product-card .related-product-button *:visited,
    a.related-product-card .related-product-button *:hover,
    a.related-product-card .related-product-button *:active,
    a.related-product-card .related-product-button *:focus {
        color: #ffffff !important;
    }
    
    .related-product-card:hover .related-product-button {
        background: #ffffff !important;
        color: #000000 !important;
        border: 2px solid #000000 !important;
    }
    
    /* Force black text on button hover on mobile - override any parent color rules */
    a.related-product-card:hover .related-product-button,
    a.related-product-card:hover .related-product-button *,
    a.related-product-card:hover .related-product-button *:link,
    a.related-product-card:hover .related-product-button *:visited,
    a.related-product-card:hover .related-product-button *:hover,
    a.related-product-card:hover .related-product-button *:active,
    a.related-product-card:hover .related-product-button *:focus {
        color: #000000 !important;
    }
    
    /* Responsive grid: 1 column on mobile */
    .minimal-grid-responsive {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .featured-article-card {
        padding: 16px !important;
    }
    
    .featured-article-title {
        font-size: 16px !important;
    }
    
    .featured-article-excerpt {
        font-size: 13px !important;
    }
    
    .minimal-nav-container {
        padding: 0 24px;
        flex-direction: column;
        gap: 16px;
    }
    
    .minimal-nav-links {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    
    .minimal-graphic {
        width: 600px;
        height: 450px;
        opacity: 0.08;
        animation-duration: 15s;
    }
    
    .minimal-graphic::before,
    .minimal-graphic::after {
        display: none; /* Simplify on mobile */
    }
}

