/* ===================================================
   Biobonz — Global Stylesheet
   =================================================== */

/* ----------- Design Tokens ----------- */
:root {
    --color-primary: #0e8f6e;
    --color-primary-dark: #0b6f55;
    --color-accent: #f0b400;
    --color-bg: #f7f9fb;
    --color-surface: #ffffff;
    --color-text: #1c2a33;
    --color-muted: #5a6b74;
    --color-border: #e6ebee;

    --shadow-sm: 0 1px 2px rgba(14, 40, 50, 0.06);
    --shadow-md: 0 6px 18px rgba(14, 40, 50, 0.08);
    --shadow-lg: 0 18px 40px rgba(14, 40, 50, 0.12);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-heading: 'Poppins', var(--font-body);

    --container-max: 1200px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----------- Reset ----------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    margin: 0 0 0.5em;
    line-height: 1.25;
    color: var(--color-text);
}

p {
    margin: 0 0 1em;
}

button,
select,
input {
    font-family: inherit;
    font-size: 1rem;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----------- Layout ----------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

main {
    flex: 1;
}

/* ----------- Header ----------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
}

.logo-link {
    display: inline-flex;
    align-items: center;
}

.logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition);
}

.logo-link:hover .logo {
    transform: scale(1.04);
}

.main-nav {
    display: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--color-muted);
    position: relative;
    padding: 0.3rem 0;
    transition: color var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.language-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.55rem 2.25rem 0.55rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a6b74' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.language-select:hover,
.language-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 143, 110, 0.15);
}

/* ----------- Hero ----------- */
.hero {
    background:
        radial-gradient(1000px 400px at 10% -10%, rgba(14, 143, 110, 0.14), transparent 60%),
        radial-gradient(800px 400px at 100% 10%, rgba(240, 180, 0, 0.12), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    max-width: 800px;
    margin: 0 auto 1rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--color-muted);
    max-width: 620px;
    margin: 0 auto 2rem;
}

/* ----------- Buttons ----------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
    will-change: transform;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-ghost {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-ghost:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ----------- Section ----------- */
.products-section {
    padding: 3rem 0 4rem;
}

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

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 700;
}

.section-subtitle {
    color: var(--color-muted);
    max-width: 560px;
    margin: 0 auto;
}

/* ----------- Product Grid ----------- */
.product-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(14, 143, 110, 0.35);
    outline: none;
}

.product-card-image-wrap {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #f1f5f4, #e6ecea);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: transform 0.5s ease;
}

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

.product-card-body {
    padding: 1rem 1.1rem 1.25rem;
    text-align: center;
}

.product-card-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.product-card-tag {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.product-card-cta {
    margin-top: 0.9rem;
    display: inline-block;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap var(--transition);
}

.product-card:hover .product-card-cta {
    text-decoration: underline;
}

/* ----------- Product Detail Page ----------- */
.product-page {
    padding: 2rem 1.25rem 4rem;
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.breadcrumb a {
    color: var(--color-muted);
    transition: color var(--transition);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: 600;
}

.product-detail {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.product-detail-image-wrap {
    background: linear-gradient(135deg, #f3f7f6, #e7eeec);
    border-radius: var(--radius-md);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-detail-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 2rem;
    transition: transform 0.6s ease;
}

.product-detail-image:hover {
    transform: scale(1.04);
}

.product-detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-detail-name {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-detail-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    background: rgba(14, 143, 110, 0.1);
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    margin-bottom: 1rem;
    width: fit-content;
}

.product-detail-description {
    color: var(--color-muted);
    font-size: 1.02rem;
    white-space: pre-line;
    margin-bottom: 1.5rem;
}

.product-detail-loading,
.product-not-found {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-muted);
    grid-column: 1 / -1;
}

.back-link-wrap {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-start;
}

/* ----------- Footer ----------- */
.site-footer {
    margin-top: 3rem;
    background: #10242e;
    color: #c8d3d8;
    padding: 1.5rem 0;
}

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

.footer-text {
    margin: 0;
    font-size: 0.9rem;
}

/* ----------- Responsive ----------- */
@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (min-width: 768px) {
    .main-nav {
        display: flex;
    }

    .hero {
        padding: 5rem 0 4rem;
    }

    .product-detail {
        grid-template-columns: 1fr 1.1fr;
        padding: 2rem;
        gap: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .product-detail {
        padding: 2.5rem;
        gap: 3rem;
    }
}

/* ----------- Fade-in animation ----------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card,
.product-detail {
    animation: fadeInUp 0.5s ease both;
}

.product-card:nth-child(2) { animation-delay: 0.05s; }
.product-card:nth-child(3) { animation-delay: 0.1s; }
.product-card:nth-child(4) { animation-delay: 0.15s; }
.product-card:nth-child(5) { animation-delay: 0.2s; }
.product-card:nth-child(6) { animation-delay: 0.25s; }
