@font-face {
    font-family: 'Cormorant-Bold';
    src: url('./fonts/Cormorant-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat-Regular';
    src: url('./fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #000000;
    --secondary-color: #4e4e4e;
    --tertiary-color: #d4af37;
    --background-color: #eeeef0;
    --secondary-background-color: #fdf9f1;
    --error-color: #b3261e;
    --pad: 100px;
    --nav-height: 100px;
}

h1 {
    font-family: 'Cormorant-Bold', sans-serif;
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
}

h2 {
    font-family: 'Cormorant-Bold', sans-serif;
    font-size: clamp(1.7rem, 4vw, 3rem);
    font-weight: 700;
    padding-bottom: 20px;
    text-transform: uppercase;
    color: var(--primary-color);
}

h3 {
    font-family: 'Cormorant-Bold', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.7rem);
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
    padding-bottom: 0px;
    color: var(--tertiary-color);
}

.product-card h3 {
    min-height: calc(1.3em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

h4 {
    font-family: 'Cormorant-Bold', sans-serif;
    font-size: clamp(1.8rem, 6vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
}

h5 {
    font-family: 'Cormorant-Bold', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.7rem);
    font-weight: 700;
    line-height: 1.4;
    color: var(--primary-color);
}

p {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    line-height: 1.5;
    padding-bottom: 28px;
    color: var(--secondary-color);
}

.product-price {
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

span {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    line-height: 1.5;
    color: var(--primary-color);
}

.btn {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: clamp(0.9rem, 1.2vw, 1.2rem);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 18px 24px;
    cursor: pointer;
    border: none;
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
}

.primary-btn:hover {
    box-shadow: inset 0 0 0 1px var(--primary-color);
    color: var(--primary-color);
    background: none;
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    background-color: var(--primary-color);
    color: var(--background-color);
}

.secondary-btn {
    background: none;
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: var(--background-color);
}

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

html {
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Cormorant-Bold', sans-serif;
    background-color: var(--background-color);
    overflow-x: hidden;
}

nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--pad);
    background: transparent;
    z-index: 999;
}

nav .logo {
    width: auto;
    height: 120px;
}

#mobile,
#cart-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

#mobile img,
#cart-icon img,
.overlay-close img {
    width: auto;
    height: 34px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 50%;
    background-color: var(--tertiary-color);
    color: var(--primary-color);
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

#navbar,
#cart-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(images/sections-background-image.webp);
    transition: top 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

body.overlay-open {
    overflow: hidden;
}

#navbar.active,
#cart-overlay.active {
    top: 0;
}

#navbar li {
    list-style: none;
    padding: 16px 0;
}

#navbar li a {
    font-family: 'Cormorant-Bold', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    color: var(--primary-color);
    transition: all ease 0.3s;
}

#navbar li a:hover,
#navbar li a.active {
    color: var(--tertiary-color);
}

.overlay-close {
    position: absolute;
    top: 70px;
    right: 75px;
    cursor: pointer;
}

@media (max-width: 900px) {
    nav {
        padding-top: 6px;
        padding-bottom: 0;
    }
}

@media (max-width: 480px) {
    nav .logo {
        width: auto;
        height: 80px;
    }

    #mobile img,
    #cart-icon img,
    .overlay-close img {
        width: auto;
        height: 24px;
    }

    .overlay-close {
        top: 30px;
        right: 30px;
    }
}

.hero {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: url('images/hero-background.webp') no-repeat center center/cover;
}

.hero-content {
    width: 50%;
    padding: 0 var(--pad);
}

@media (max-width: 900px) {
    .hero {
        height: 80vh;
        justify-content: center;
        text-align: center;
        padding: var(--pad) 0;
        position: relative;
        background: none;
    }

    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: url('images/hero-background.webp') no-repeat right center/cover;
        filter: grayscale(60%) brightness(0.55);
        z-index: 0;
    }

    .hero-content {
        width: 100%;
        position: relative;
        z-index: 1;
    }

    .hero-content h1,
    .hero-content p {
        color: var(--background-color);
        z-index: 1;
    }

    .primary-btn {
        background-color: var(--background-color);
        color: var(--primary-color);
        border: none;
    }

    .primary-btn:hover {
        box-shadow: inset 0 0 0 1px var(--background-color);
        color: var(--background-color);
        background: none;
    }
}

.products {
    padding: var(--pad);
    text-align: center;
    background: url(images/sections-background-image.webp);
}

.products p {
    max-width: 50%;
    margin: 0 auto;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    list-style: none;
    margin-bottom: 100px;
}

.tabs a {
    font-family: 'Cormorant-Bold', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    text-transform: uppercase;
    text-decoration: none;
    color: var(--primary-color);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tabs a:hover,
.tabs a.active {
    color: var(--tertiary-color);
    border-bottom-color: var(--tertiary-color);
}

.product-slider {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.slider-btn {
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.slider-btn img {
    width: auto;
    height: 80px;
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Viewport: clips everything outside it, never grows past the slider */
.product-grid-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Track: the part that actually moves */
.product-track {
    display: flex;
    width: 100%;
    transition: transform 0.4s ease;
    will-change: transform;
    --cards-visible: 3;
    /* synced on load + resize by JS, see applyVisibleCardsVar() */
}

/* When there aren't enough products to fill a page, center them instead of sliding */
.product-track.center {
    justify-content: center;
}

.product-card {
    flex: 0 0 calc(100% / var(--cards-visible));
    min-width: 0;
    box-sizing: border-box;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: auto;
    max-width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
    margin: 0 auto 30px;
}

.product-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.product-details p {
    padding-bottom: 0;
    margin: 0;
}

.product-tagline {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    line-height: 1.4;
    color: var(--tertiary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 5px;
    min-height: calc(1.4em * 2 + 16px);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    box-sizing: border-box;
}

.price-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.original-price,
.product-price {
    white-space: nowrap;
}

.original-price {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    color: var(--secondary-color);
    text-decoration: line-through;
}

.add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Tablet: 2 visible */
@media (max-width: 1080px) {

    .products p {
        max-width: 70%;
    }

    .product-track {
        --cards-visible: 2;
    }

    .product-details {
        display: flex;
        flex-direction: column;
    }

    .slider-btn .back {
        padding-left: 0;
    }

    .slider-btn .next {
        padding-right: 0;
    }
}

/* Mobile: 1 visible */
@media (max-width: 768px) {

    .products p {
        max-width: 90%;
    }

    .tabs {
        margin-bottom: 50px;
    }

    .product-track {
        --cards-visible: 1;
    }

    .product-card img {
        max-height: 250px;
        object-fit: cover;
    }

    .product-details {
        display: flex;
        flex-direction: column;
    }

    .slider-btn {
        padding: 0;
    }

    .slider-btn img {
        height: 50px;
    }
}


.banner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 20px var(--pad);
    gap: var(--pad);
    background-color: var(--secondary-background-color);
}

.banner-image {
    width: 60%;
}

.banner-image img {
    width: 100%;
    height: auto;
}

.banner-content {
    text-align: left;
    width: 40%;
}

@media (max-width: 768px) {
    .banner {
        flex-direction: column;
        text-align: center;
    }

    .banner-image,
    .banner-content {
        width: 100%;
    }

    .banner-content {
        text-align: center;
    }
}

.product-features {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--pad);
    background: url(images/sections-background-image.webp);
}

.features {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--pad);
    width: 100%;
}

/* Unwraps these divs so their h5 children become direct grid items of
   .features — that's what lets each left/right pair share one grid row
   and take on the height of whichever side is taller. */
.left-row-features,
.right-row-features {
    display: contents;
}

.left-row-features h5:nth-of-type(1) { grid-row: 1; grid-column: 1; }
.left-row-features h5:nth-of-type(2) { grid-row: 2; grid-column: 1; }
.left-row-features h5:nth-of-type(3) { grid-row: 3; grid-column: 1; }

.right-row-features h5:nth-of-type(1) { grid-row: 1; grid-column: 3; }
.right-row-features h5:nth-of-type(2) { grid-row: 2; grid-column: 3; }
.right-row-features h5:nth-of-type(3) { grid-row: 3; grid-column: 3; }

.left-row-features h5 { text-align: right; }
.right-row-features h5 { text-align: left; }

.product-image {
    grid-row: 1 / span 3;
    grid-column: 2;
}

.product-image img {
    width: 100%;
    height: 500px;
    object-fit: contain;
}

.features-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 50px;
}

.features-buttons .slider-btn {
    padding: 0;
}

@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .product-image {
        grid-row: 1;
        grid-column: 1 / span 2;
    }

    .product-image img {
        height: 320px;
    }

    .left-row-features h5:nth-of-type(1) { grid-row: 2; grid-column: 1; }
    .left-row-features h5:nth-of-type(2) { grid-row: 3; grid-column: 1; }
    .left-row-features h5:nth-of-type(3) { grid-row: 4; grid-column: 1; }

    .right-row-features h5:nth-of-type(1) { grid-row: 2; grid-column: 2; }
    .right-row-features h5:nth-of-type(2) { grid-row: 3; grid-column: 2; }
    .right-row-features h5:nth-of-type(3) { grid-row: 4; grid-column: 2; }

    .left-row-features h5,
    .right-row-features h5 {
        text-align: left;
    }

    .features-buttons .slider-btn {
        padding-top: 20px;
    }
}

/* ============ FEEDBACK ============ */
.feedback {
    width: 100%;
    padding: var(--pad);
    text-align: center;
    box-sizing: border-box;
    background: url(images/sections-background-image.webp);
}

.feedback-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 50px;
    text-align: left;
}

.feedback-content,
.feedback-image {
    width: 50%;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-content {
    flex-direction: column;
    align-items: flex-start;
}

.feedback-content p {
    overflow-wrap: break-word;
    word-break: break-word;
}

.feedback-image img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============ FEEDBACK RESPONSIVE ============ */
@media (max-width: 900px) {
    .feedback-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .feedback-content,
    .feedback-image {
        width: 100%;
    }

    .feedback-content {
        align-items: center;
    }
}


/* ============ PERKS ============ */
.perks {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: clamp(20px, 4vw, 60px);
    padding: var(--pad);
    box-sizing: border-box;
}

.perk-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    flex: 1 1 200px;
    min-width: 0;
    max-width: 260px;
}

.perk-card img {
    width: 60px;
    height: auto;
    object-fit: contain;
    margin-bottom: 16px;
}



/* ============ PERKS RESPONSIVE ============ */
@media (max-width: 600px) {
    .perks {
        gap: 24px;
    }

    .perk-card {
        flex: 1 1 100px;
        max-width: 140px;
    }

    .perk-card img {
        width: 44px;
        height: auto;
    }
}


/* ============ FOOTER ============ */
footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 40px);
    padding: 40px var(--pad);
    background-color: var(--background-color);
}

.social-media {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.social-media a,
.copyright a {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

.footer-logo {
    flex: 1;
    display: flex;
    justify-content: center;
}

.footer-logo img {
    max-width: 180px;
    width: 100%;
    height: auto;
    display: block;
}

.copyright {
    flex: 1;
    text-align: right;
    white-space: nowrap;
}

/* ============ FOOTER RESPONSIVE ============ */
@media (max-width: 700px) {
    footer {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .social-media,
    .footer-logo,
    .copyright {
        flex: none;
        width: 100%;
        justify-content: center;
    }

    .footer-logo {
        order: 1;
    }

    .social-media {
        order: 2;
        justify-content: center;
    }

    .copyright {
        order: 3;
        text-align: center;
        white-space: normal;
    }
}

/* ============ CART OVERLAY ============ */
#cart-overlay {
    padding: 100px var(--pad) 40px;
    justify-content: flex-start;
}

.cart-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: row;
    gap: 60px;
    align-items: flex-start;
}

.cart-left,
.cart-right {
    flex: 1 1 50%;
    min-width: 0;
    width: 50%;
}

.cart-left h3,
.cart-right h3 {
    margin-bottom: 20px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.cart-item-name {
    font-family: 'Montserrat-Regular', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    word-break: break-word;
}

.cart-item-qty {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.cart-item-price {
    font-family: 'Montserrat-Regular', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.cart-remove {
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.cart-remove img {
    width: 16px;
    height: 16px;
}

.cart-empty-message {
    font-family: 'Montserrat-Regular', sans-serif;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.cart-totals p {
    font-family: 'Montserrat-Regular', sans-serif;
    padding-bottom: 8px;
    color: var(--primary-color);
}

.cart-total {
    font-weight: 700;
    font-size: 1.1rem;
}

#checkout-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-group label {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea {
    font-family: 'Montserrat-Regular', sans-serif;
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background-color: var(--background-color);
    color: var(--primary-color);
    width: 100%;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--tertiary-color);
    outline-offset: 1px;
}

.order-feedback {
    font-family: 'Montserrat-Regular', sans-serif;
    padding: 10px 12px;
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--primary-color);
    border-left: 3px solid var(--tertiary-color);
}

.order-feedback.is-error {
    background-color: rgba(179, 38, 30, 0.1);
    border-left-color: var(--error-color);
    color: var(--error-color);
}

#place-order {
    width: 100%;
}

@media (max-width: 900px) {
    #cart-overlay {
        padding: 90px 24px 40px;
    }

    .cart-container {
        flex-direction: column;
        gap: 40px;
    }

    .cart-left,
    .cart-right {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ============ 404 PAGE ============ */
.not-found {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    padding: var(--pad) 20px;
}

.not-found .logo {
    height: 100px;
    width: auto;
    margin-bottom: 20px;
}