/*
Theme Name: 4DChess Creative Co
Description: Custom WordPress theme for 4DChess Creative Co - Strategic 3D Printing Solutions
Author: Custom Design
Version: 1.0
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e3c72;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.site-logo:hover {
    color: #ff6b35;
}

.site-logo img {
    width: auto;
    height: auto;
    transition: all 0.3s ease;
}

/* Navigation Styles */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a.current-menu-item {
    background: linear-gradient(180deg, #2b2b2b 0%, #000000 100%);
    color: white;
    border: 1px solid #111;
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .main-navigation.active {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }
    
    .main-navigation a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid #eee;
    }
}

/* Main Content */
.site-main {
    margin-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 80px);
}

/* Hero Sections */
.hero-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="40" cy="70" r="1" fill="rgba(255,255,255,0.08)"/></svg>');
    pointer-events: none;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.hero-section p {
    font-size: 1.4rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.hero-section .btn {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin: 0.5rem;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.btn-primary {
    background: linear-gradient(180deg, #2b2b2b 0%, #000000 100%);
    color: white;
    border: 1px solid #111;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #3a3a3a 0%, #111111 100%);
    transform: translateY(-2px);
}

.btn-secondary {
    border: 2px solid #111;
    color: #111;
    background: transparent;
}

.btn-secondary:hover {
    background: #111;
    color: white;
}

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hero CTA – refined modern pill */
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    background: linear-gradient(180deg, #181818 0%, #000 100%);
    color: #fff !important;
    border: 1px solid #2a2a2a;
    border-radius: 9999px;
    padding: 12px 22px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn-cta:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #202020 0%, #0a0a0a 100%);
    border-color: #3a3a3a;
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}

.btn-cta:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* Pulse animation for attention-grabbing CTA */
@keyframes pulse {
    0% { box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
    50% { box-shadow: 0 8px 22px rgba(0,0,0,0.35); }
    100% { box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
}

.btn-cta {
    animation: pulse 3s infinite 1s;
}

.btn-cta:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,99,255,0.15), 0 6px 18px rgba(0,0,0,0.25);
}

.btn-cta::after {
    content: '→';
    font-weight: 600;
    transition: transform .15s ease;
}

.btn-cta:hover::after {
    transform: translateX(4px);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

/* Cards */
.card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

.card-icon {
    font-size: 3rem;
    color: #ff6b35;
    margin-bottom: 1rem;
}

.card h3 {
    color: #333;
    margin-bottom: 1rem;
}

.card p {
    color: #666;
    line-height: 1.6;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-alt {
    background: #f8f9fa;
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

/* Forms */
.contact-form {
    max-width: 800px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 3rem;
    border-radius: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 5px rgba(255, 107, 53, 0.3);
}

.btn-submit {
    background: #ff6b35;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

/* Portfolio */
.portfolio-filter {
    text-align: center;
    margin-bottom: 3rem;
}

.filter-btn {
    background: white;
    color: #333;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    margin: 0.5rem;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: #111;
    color: white;
    border-color: #111;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item.hidden {
    display: none;
}

.portfolio-image {
    height: 250px;
    background: #ddd;
    position: relative;
    overflow: hidden;
}

.portfolio-content {
    padding: 2rem;
}

/* Footer */
.site-footer {
    background: #1e3c72;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #ff6b35;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section ul {
    color: #ccc;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: #ff6b35;
}

.footer-bottom {
    border-top: 1px solid #2a5298;
    padding-top: 2rem;
    text-align: center;
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .hero-section p {
        font-size: 1.2rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .section h2 {
        font-size: 1.8rem;
    }

    /* Mobile product grid adjustments */
    .products-grid {
        gap: 1.5rem;
    }

    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    /* Enhanced mobile touch interactions */
    .card, .btn, .product-card {
        -webkit-tap-highlight-color: rgba(255, 107, 53, 0.2);
        touch-action: manipulation;
    }

    /* Improve button touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-cta {
        min-height: 48px;
        padding: 14px 24px;
    }

    /* Better mobile navigation */
    .mobile-menu-toggle {
        padding: 12px;
        border-radius: 6px;
    }

    /* Enhanced mobile card interactions */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .card:hover {
        transform: translateY(-2px); /* Reduced for mobile */
    }

    /* Mobile-optimized cart drawer */
    .cart-drawer {
        width: 100%;
        max-width: 100vw;
    }

    .cart-drawer-header {
        padding: 20px;
    }

    .cart-drawer-body {
        padding: 20px;
    }

    /* Better mobile spacing */
    .container {
        padding: 0 16px;
    }

    .section {
        padding: 60px 0;
    }

    .hero-section {
        padding: 60px 0;
    }

    /* Mobile-specific animations */
    .card {
        animation-duration: 0.4s; /* Faster on mobile for better performance */
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none; /* Remove hover effects on touch devices */
        box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Maintain shadow */
    }

    .btn:hover {
        transform: none; /* Remove hover transforms on touch */
    }

    /* Add active states for touch feedback */
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-orange {
    color: #111; /* neutralize old accent */
}

.bg-alt {
    background: #f8f9fa;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mb-3 {
    margin-bottom: 3rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none;
}

/* WordPress Specific */
.wp-post-image {
    max-width: 100%;
    height: auto;
}

.aligncenter {
    text-align: center;
}

.alignleft {
    float: left;
    margin-right: 1rem;
}

.alignright {
    float: right;
    margin-left: 1rem;
}

/* Marketplace Products Styles */
.marketplace-products {
    margin: 2rem 0;
}

.products-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 250px; /* Fallback for browsers without aspect-ratio support */
    aspect-ratio: 4/5;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Reset height for browsers that support aspect-ratio */
@supports (aspect-ratio: 4/5) {
    .product-image {
        height: auto;
    }
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

/* Out of stock overlay styles */

.stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    z-index: 2;
}

.out-of-stock .product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.out-of-stock .product-image img {
    filter: grayscale(100%);
    opacity: 0.6;
}

.product-details {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111;
    margin-bottom: 1rem;
}

.product-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-actions {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.btn-fb {
    background: #1877f2;
    color: white !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.btn-fb:hover {
    background: #166fe5;
}

.payment-options {
    margin-top: 1rem;
}

.payment-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.payment-btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 0.25rem 0.25rem 0.25rem 0;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
}

.venmo-btn {
    background: #3d95ce;
}

.venmo-btn:hover {
    background: #2a7bb3;
    color: white;
}

.cashapp-btn {
    background: #00c244;
}

.cashapp-btn:hover {
    background: #00a339;
    color: white;
}

.paypal-btn {
    background: #0070ba;
}

.paypal-btn:hover {
    background: #005ea6;
    color: white;
}

.stripe-btn {
    background: #635bff;
}

.stripe-btn:hover {
    background: #5851e6;
    color: white;
}

/* Marketplace Section */
.marketplace-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.marketplace-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.marketplace-section .section-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem;
    color: #666;
    font-size: 1.1rem;
}

.facebook-profile-link {
    text-align: center;
    margin: 2rem 0;
}

.facebook-profile-link .btn {
    background: #1877f2;
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: background 0.3s ease;
}

.facebook-profile-link .btn:hover {
    background: #166fe5;
}

/* Stock Management Styles */
.product-card.out-of-stock {
    opacity: 0.7;
    position: relative;
}

.product-card.out-of-stock .product-image {
    position: relative;
}

.stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.stock-warning {
    background: #fff3cd;
    color: #856404;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 1rem 0;
    text-align: center;
    border: 1px solid #ffeaa7;
}

.out-of-stock-message {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.out-of-stock-message p {
    margin-bottom: 1rem;
    color: #6c757d;
}

/* Enhanced Payment Options */
.payment-options {
    margin-top: 1rem;
}

.payment-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.payment-btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 0.25rem 0.25rem 0.25rem 0;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: white;
    border: none;
    cursor: pointer;
}

.payment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Add to Cart button (attribute targeted) */
.payment-btn[data-add-to-cart] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 40%), linear-gradient(180deg, #121212 0%, #000 100%);
    color: #fff;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 12px 20px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
    letter-spacing: .15px;
}

.payment-btn[data-add-to-cart]:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #202020 0%, #0a0a0a 100%);
    border-color: #3a3a3a;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

.payment-btn[data-add-to-cart]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,99,255,0.15), 0 6px 18px rgba(0,0,0,0.2);
}

/* remove pseudo icon to avoid duplicates */
.payment-btn[data-add-to-cart]::before { content: none; }

/* Responsive Design for Products */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .payment-btn {
        display: block;
        text-align: center;
        margin: 0.5rem 0;
    }
    
    .marketplace-section {
        padding: 60px 0;
    }
    
    .marketplace-section h2 {
        font-size: 2rem;
    }
}