/* Reset */

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

* {
    margin: 0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

#root, #__next {
    isolation: isolate;
}

/* Page style */

:root {
    --small-space: 0.5rem;
    --medium-space: 1.5rem;
    --large-space: 5rem;
    --content-margin: var(--large-space);

    --accent: #FFCC00;
    --accent-translucent: rgba(255, 204, 0, 0.2);
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #444444;
}

@font-face {
    font-family: 'Arvo';
    src: url('Arvo.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('Lato-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'ChrisHand';
    src: url('ChrisHand-Regular.woff2') format('woff2'),
    url('ChrisHand-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 18pt;
}

header {
    background: var(--bg-primary);
    padding: var(--medium-space) var(--content-margin);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-nav {
    display: flex;
    gap: var(--medium-space);
}

.dropdown {
    position: relative;
    display: inline-block;
    width: 250px;
}

.dropdown-button {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--accent);
    padding: var(--small-space) var(--medium-space);
    cursor: pointer;
    border-radius: 4px;
    font-size: 14pt;
    width: 100%;
}

.dropdown-button:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.dropdown:hover .dropdown-button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 4px 4px;
    border-top: none;
    width: 100%;
    white-space: nowrap;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 1;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown:hover .dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: var(--small-space) var(--medium-space);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    font-size: 12pt;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: var(--bg-primary);
}


main {
    padding: 0 var(--content-margin);
}

h1 {
    display: flex;
    flex-direction: row;
    font-family: 'Arvo', serif;
    align-items: baseline;
    gap: 15px;
    font-size: 24pt;
    border: 0;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 3px;
    margin: 0;
}

h1 a {
    color: inherit;
    text-decoration: inherit;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 15px;
}

h1 img {
    height: 0.8em;
    vertical-align: baseline;
}

h2, h3 {
    margin: var(--medium-space) 0;
}

.product {
    margin-bottom: var(--medium-space);
}


.product h5 {
    margin-top: var(--medium-space);
    margin-bottom: var(--medium-space);
    border-bottom: 1px solid var(--border-color);
}

.product th, .product td {
    padding: var(--small-space);
}


p {
    margin: var(--small-space) 0;
}

a {
    color: var(--accent);
}

.preview {
    float: right;
    background: var(--bg-primary);
    padding: var(--medium-space);
}

.preview img {
    max-width: 800px;
    max-height: 800px;
    border: 3px solid var(--accent);
    border-radius: 8px;
    margin: var(--medium-space);
}

.images {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.images {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: var(--medium-space) 0;
}

.thumb {
    width: 300px;
    height: 300px;
    border-radius: 10px;
    display: inline-flex;
    justify-content: center;
    background-color: var(--bg-secondary);
}

.thumb img, .thumb video {
    object-fit: cover;
    border-radius: 10px;
    width: 100%;
    height: 100%;
}

.buy {
    display: inline-block;
    background-color: var(--accent);
    color: #000000;
    text-transform: uppercase;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    margin: 8px 0;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 200ms ease-out;
}

.buy:hover, .buy:active {
    opacity: 0.8;
}

.discount {
    color: #999999;
    font-size: x-small;
    vertical-align: top;
}

th {
    text-align: left;
}

footer {
    font-size: small;
    margin-top: var(--large-space);
    padding: var(--small-space);
    text-align: center;
    color: var(--text-secondary);
}

/* Product teasers */

.products-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(-1 * var(--content-margin));
    gap: 2px;
}

.product-teaser {
    margin: 0;
    flex: 1 1 600px;
    max-width: 800px;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-teaser a {
    text-decoration: none;
    color: inherit;
}

.teaser-image {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 0;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

.teaser-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 300ms ease-in-out, transform 300ms ease-in-out;
}

.product-teaser:hover .teaser-image img {
    opacity: 1;
    transform: scale(1.05);
}

.teaser-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: var(--medium-space) var(--small-space) var(--small-space);
    color: white;
}

.teaser-overlay h4 {
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Intro cell */

.intro-cell {
    margin: 0;
    flex: 1 1 600px;
    box-sizing: border-box;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

.intro-content {
    padding: var(--medium-space);
}

.intro-content p {
    margin: 0 0 var(--small-space) 0;
}

.intro-content p:last-child {
    margin: 0;
}

/* Category page styling */
.intro-content h1 {
    text-decoration: none;
    margin-bottom: var(--medium-space);
}

/* Tablet and mobile header styles */
@media (max-width: 1200px) {
    /* Header mobile layout */
    header {
        flex-direction: column;
        gap: var(--medium-space);
        align-items: stretch;
        text-align: center;
    }

    .header-nav {
        flex-direction: column;
        align-items: center;
    }

    .dropdown {
        width: 100%;
        max-width: 300px;
    }

    h1 {
        justify-content: center;
    }

    .product-teaser, .intro-cell {
        flex: 1 1 450px;
    }

    .preview {
        float: none;
        display: block;
        margin: var(--medium-space) 0;
        text-align: center;
        max-width: 100%;
        padding: 0;
    }

    .preview img {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: auto;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    :root {
        --content-margin: var(--medium-space);
    }

    /* Product grid mobile layout */
    .products-grid {
        flex-direction: column;
        margin: 0;
    }

    .product-teaser, .intro-cell {
        flex: none;
        max-width: none;
    }

    /* Remove fixed height from intro cell on mobile */
    .intro-cell {
        height: auto;
        min-height: 200px;
        padding: var(--medium-space);
    }

    /* Smaller thumbnails on mobile */
    .thumb {
        width: 250px;
        height: 250px;
    }

    /* Stack images vertically on mobile */
    .images {
        flex-direction: column;
        align-items: center;
    }

    /* Adjust font sizes for mobile */
    body {
        font-size: 16pt;
    }

    h1 {
        font-size: 20pt;
        flex-direction: column;
        gap: var(--small-space);
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .dropdown-button {
        font-size: 16pt;
    }
}

/* Currency dropdown specific styles */
.currency-dropdown {
    width: 200px;
}

/* Price disclaimer */
.price-disclaimer {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: var(--small-space);
}

/* Handwritten Letter Styles */
.handwritten-letter {
    background: var(--bg-secondary);
    padding: 3em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: rotate(-0.5deg);
    max-width: 800px;
    margin: 0 auto;
}

.letter-content {
    position: relative;
    z-index: 1;
}

.letter-content::after {
    content: '';
    display: table;
    clear: both;
}

.letter-greeting {
    font-family: 'ChrisHand', cursive;
    font-size: 2.2em;
    color: var(--text-primary);
    margin-bottom: 1em;
}

.letter-body {
    font-family: 'ChrisHand', cursive;
    font-size: 1.4em;
    color: var(--text-primary);
    line-height: 1.4;
}

.letter-body p {
    margin-bottom: 1.2em;
}

.brand-name {
    color: var(--accent);
    font-weight: bold;
}

.letter-signature {
    font-family: 'ChrisHand', cursive;
    font-size: 1.5em;
    font-style: italic;
    color: var(--text-primary);
    margin-top: 2em;
    float: right;
    margin-right: 2em;
    position: relative;
    display: inline-block;
}

.letter-signature::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: -5px;
    right: -10px;
    height: 2px;
    background: var(--text-primary);
    transform: rotate(-5deg);
    transform-origin: center;
}

.home-content {
    margin-top: var(--large-space);
}

/* Large screen layout - letter and featured products side by side */
@media (min-width: 2000px) {
    .home-content {
        display: flex;
        gap: var(--large-space);
        align-items: stretch;
    }

    .handwritten-letter {
        flex: 0 0 800px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .product-carousel {
        flex: 1;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
}

.product-carousel {
    position: relative;
    overflow: hidden;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-areas: "header header"
                         "body image";
    align-items: center;
    gap: var(--medium-space);
    padding: calc(var(--medium-space) + 0px) calc(var(--medium-space) + 60px) calc(var(--medium-space) + 40px) calc(var(--medium-space) + 60px);
    flex-direction: row-reverse;

    h3 {
        grid-area: header;
        color: var(--accent);
        font-family: 'Arvo', serif;
        font-size: 2em;
        margin: 0;
        line-height: 1.2;
        padding: var(--medium-space);
    }

    img {
        grid-area: image;
        border-radius: 8px;
        max-height: 700px;
        object-fit: cover;
    }

    .carousel-content {
        grid-area: body;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: var(--medium-space);
        height: 100%;
        padding: var(--medium-space);

        .product-description {
            color: var(--text-secondary);
            margin: 0;
            flex: 1;
        }

        .product-price {
            font-size: 1.5em;
            font-weight: bold;
            color: var(--accent);
            margin: 0;
        }

        .product-link {
            display: inline-block;
            background: var(--accent);
            color: var(--bg-primary);
            padding: var(--medium-space) var(--large-space);
            text-decoration: none;
            border-radius: 8px;
            font-weight: bold;
            font-size: 1.2em;
            transition: background-color 0.3s ease;
            width: fit-content;

            &:hover {
                background: #e6b800;
            }
        }
    }
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    border: none;
    color: var(--bg-primary);
    font-size: 2em;
    font-weight: bold;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.2;
}

.carousel-nav:hover {
    opacity: 1;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-indicator.active {
    background: var(--accent);
}

/* Mobile carousel styles */
@media (max-width: 768px) {
    .carousel-slide {
        padding: var(--medium-space);
        grid-template-areas: "header"
                             "image"
                             "body";

        img {
            height: 300px;
            width: 100%;
        }

        h3 {
            font-size: 1.8em;
        }
    }

    .carousel-nav {
        width: 45px;
        height: 45px;
        font-size: 1.5em;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }
}

/* Browse Categories */
.browse-categories {
    margin: var(--large-space) var(--content-margin);
}

.browse-categories h2 {
    color: var(--accent);
    font-family: 'Arvo', serif;
    font-size: 2em;
    margin-bottom: var(--medium-space);
    text-align: center;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--medium-space);
}

.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--medium-space);
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.category-card .category-icon {
    font-size: 3em;
    margin-bottom: var(--small-space);
}

.category-card h3 {
    color: var(--accent);
    font-family: 'Arvo', serif;
    font-size: 1.3em;
    margin-bottom: var(--small-space);
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9em;
}