/*
Theme Name: Stoklink
Theme URI: https://stoklink.co
Author: Stoklink
Author URI: https://stoklink.co
Description: Lightweight custom WordPress theme for Stoklink — The Retail Network. Ships with a code-based router for adding pages without touching wp-admin, plus a fullscreen blank template that renders the [stoklink_app] shortcode for mounting the Stoklink web app.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: stoklink
*/

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

:root {
    --dark: #1a1410;
    --navy: #2d3a4a;
    --warm-brown: #8b6f47;
    --accent-gold: #d4a574;
    --accent-teal: #2b7a78;
    --light-bg: #faf8f5;
    --white: #ffffff;
    --text-dark: #2c2c2c;
    --text-light: #666666;
    --border: #e8e3dd;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Trebuchet MS, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* -------------------------------------------------------
   Header
------------------------------------------------------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
}

.logo img,
.logo .custom-logo {
    width: 30px;
    height: auto;
    margin: 0 8px 0 0;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-teal);
}

.contact-btn {
    background: var(--accent-teal);
    color: white;
    padding: 0.75rem 1.8rem;
    border-radius: 4px;
    font-weight: 700;
    transition: all 0.3s;
    white-space: nowrap;
}

.contact-btn:hover {
    background: var(--dark);
    transform: translateY(-2px);
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--dark);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .nav-links.is-open {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1.5rem 2rem;
        border-bottom: 1px solid var(--border);
    }
    .menu-toggle {
        display: block;
    }
}

/* -------------------------------------------------------
   Hero Section
------------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, #3d3531 100%);
    color: var(--white);
    padding: 8rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    animation: fadeInUp 0.8s ease-out;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent-gold);
}

.hero p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-cta {
    display: inline-flex;
    gap: 1rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--dark);
    padding: 1rem 3rem;
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: 4px;
    transition: all 0.3s;
    border: 2px solid var(--accent-gold);
    display: inline-block;
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-gold);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    padding: 1rem 3rem;
    font-weight: 800;
    font-size: 1.05rem;
    border: 2px solid var(--white);
    border-radius: 4px;
    transition: all 0.3s;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--dark);
}

.hero-visual {
    margin-top: 3.5rem;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-visual svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.hv-caption {
    margin-top: 1rem;
    font-size: 0.95rem !important;
    color: rgba(255, 255, 255, 0.65) !important;
    animation: none !important;
}

.hv-path {
    stroke-dasharray: 6 8;
    animation: dashFlow 1s linear infinite;
}

.hv-pulse {
    transform-origin: 240px 95px;
    animation: pulseRing 2s ease-out infinite;
}

.hv-pulse-delay {
    animation-delay: 1s;
}

@keyframes dashFlow {
    to { stroke-dashoffset: -28; }
}

@keyframes pulseRing {
    0% { opacity: 0.9; transform: scale(0.5); }
    70% { opacity: 0; transform: scale(2.2); }
    100% { opacity: 0; transform: scale(2.2); }
}

@media (prefers-reduced-motion: reduce) {
    .hv-path, .hv-pulse, .hv-pulse-delay {
        animation: none;
    }
    .hero-visual animateMotion, .hero-visual animate {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3.5rem 1.25rem;
    }
    .hero::before {
        width: 380px;
        height: 380px;
        top: -30%;
        right: -30%;
    }
    .hero h1 {
        font-size: 2.1rem;
        margin-bottom: 1rem;
    }
    .hero p {
        font-size: 1.05rem;
        margin-bottom: 0;
    }
    .hero-visual {
        margin-top: 2.25rem;
        max-width: 340px;
    }
    .hv-caption {
        font-size: 0.88rem !important;
        padding: 0 0.5rem;
    }
    .hero-cta {
        flex-direction: column;
    }
}

/* -------------------------------------------------------
   Sections / Layout
------------------------------------------------------- */
section {
    padding: 6rem 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease-out;
}

.section-header h2 em {
    font-style: normal;
    color: var(--accent-gold);
}

.section-header p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

/* -------------------------------------------------------
   Flow / How It Works
------------------------------------------------------- */
.how-it-works {
    background: var(--light-bg);
}

.flow-container {
    max-width: 1000px;
    margin: 0 auto;
}

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

.step {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 8px;
    border: 2px solid var(--border);
    position: relative;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

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

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--accent-gold);
    color: var(--dark);
    font-size: 1.8rem;
    font-weight: 900;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.step h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* -------------------------------------------------------
   Timeline / Example
------------------------------------------------------- */
.example-section {
    background: var(--dark);
    color: var(--white);
}

.timeline-item {
    background: rgba(212, 165, 116, 0.1);
    border-left: 4px solid var(--accent-gold);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    animation: slideInLeft 0.5s ease-out forwards;
    opacity: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0s; }
.timeline-item:nth-child(2) { animation-delay: 0.08s; }
.timeline-item:nth-child(3) { animation-delay: 0.16s; }
.timeline-item:nth-child(4) { animation-delay: 0.24s; }
.timeline-item:nth-child(5) { animation-delay: 0.32s; }
.timeline-item:nth-child(6) { animation-delay: 0.4s; }
.timeline-item:nth-child(7) { animation-delay: 0.48s; }

.timeline-time {
    font-weight: 800;
    color: var(--accent-gold);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.timeline-event {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.highlight-box {
    background: var(--accent-gold);
    color: var(--dark);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    font-weight: 700;
    line-height: 1.8;
}

/* -------------------------------------------------------
   Features Grid
------------------------------------------------------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--white);
    transition: all 0.4s;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

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

.feature:hover {
    background: var(--light-bg);
    border-color: var(--accent-gold);
    transform: translateY(-6px);
}

.feature h4 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.feature p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* -------------------------------------------------------
   CTA Section
------------------------------------------------------- */
.cta-section {
    background: linear-gradient(135deg, var(--accent-teal) 0%, #1e5a58 100%);
    color: var(--white);
    text-align: center;
    padding: 5rem 2rem;
    border-radius: 8px;
    animation: fadeInUp 0.7s ease-out;
}

.cta-section h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.cta-section p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: #25D366;
    color: white;
    padding: 1rem 2.5rem;
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: 4px;
    transition: all 0.3s;
    border: 2px solid #25D366;
}

.whatsapp-btn:hover {
    background: white;
    color: #25D366;
}

/* -------------------------------------------------------
   Footer
------------------------------------------------------- */
.site-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 2rem;
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-weight: 600;
}

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

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

@media (max-width: 768px) {
    section {
        padding: 3rem 1.5rem;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .services-grid {
        gap: 1.5rem;
    }
    .flow-steps {
        gap: 1rem;
    }
    .step {
        padding: 1.5rem;
    }
}

/* -------------------------------------------------------
   Fullscreen App Template ([stoklink_app])
------------------------------------------------------- */
body.stoklink-app-template {
    margin: 0;
    overflow: hidden;
    background: var(--white);
}

.stoklink-app-root {
    width: 100%;
}

.stoklink-app-root.stoklink-app-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.stoklink-app-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.stoklink-app-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    padding: 2rem;
}
