/* Base and Variables */
:root {
    --primary-color: #e66d32;
    --primary-hover: #cf5e28;
    --text-dark: #6d2320;
    --text-light: #6b7280;
    --bg-light: #f6f9fb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Oswald', sans-serif;
    --font-quote: 'Playfair Display', serif;
    --transition: all 0.3s ease;
}

/* Prevent text selection on UI / decorative elements */
.hero,
.navbar,
.footer,
.btn {
    user-select: none;
}

/* Change the color of the highlighted text */
::selection {
    background-color: var(--text-dark);
    /* Set background color of highlighted text */
    color: var(--bg-white);
    /* Set text color of highlighted text */
}

/* Hide blinking caret outside form fields */
.hero,
h1,
h2,
h3,
h4 {
    caret-color: transparent;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
}

a {
    text-decoration: underline;
    color: var(--primary-color);
}

a:hover {
    text-decoration: none;
    color: var(--primary-hover);
    transition-duration: 0.5s;
}

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

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

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
}

.book-title {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 5rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: var(--bg-white);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    text-transform: uppercase;
    border-radius: 4px;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-family: var(--font-main);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--bg-white);
    color: var(--text-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--bg-white);
    border: 2px solid var(--bg-white);
}

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

.btn-3 {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-3:hover {
    background-color: var(--text-dark);
    color: var(--bg-white);
}


/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    text-decoration: none;
    text-transform: uppercase;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a {
    text-decoration: none;
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-dark);
    margin-left: 2rem;
    font-weight: 400;
    transition: var(--transition);
}

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

/* Sections */
.section {
    padding: 6rem 0;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    background: url('../images/malta-header.jpg') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--bg-white);
    width: 100%;
}

.hero-grid {
    display: grid;
    grid-template-columns: 4fr 6fr;
    grid-template-areas:
        "image text"
        "image buttons";
    column-gap: 4rem;
    row-gap: 2rem;
    align-items: center;
}

.hero-text {
    grid-area: text;
    text-align: left;
    align-self: end;
}

.hero-subtext {
    font-style: italic;
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0;
    font-weight: 300;
}

.cta-buttons {
    grid-area: buttons;
    display: flex;
    justify-content: flex-start;
    gap: 1.5rem;
    align-self: start;
}

.hero-image {
    grid-area: image;
    display: flex;
    justify-content: flex-end;
}

.hero-book-cover {
    max-width: 100%;
    border-radius: 8px;
}

/* About Section */
.about {
    background-color: var(--bg-white);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.author-img {
    border-radius: 8px;
    /*box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);*/
}

.about-text p {
    margin-bottom: 1.2rem;
    color: var(--text-light);
}

.about-more {
    grid-column: 1 / -1;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease-in-out;
    margin-top: 0;
}

.about-more.show {
    max-height: 2000px;
    /* Large enough to fit content */
    opacity: 1;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.about-more p {
    margin-bottom: 1.2rem;
    color: var(--text-light);
}

/* Shop Section */
.shop-header {
    text-align: center;
    margin-bottom: 4rem;
}

.shop-banner {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.book-cover {
    border-radius: 4px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
}

.product-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.tax-info {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 400;
}

.product-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.book-highlights {
    list-style-position: inside;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.book-highlights li {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    margin-left: 5px;
    font-weight: 600;
}

.book-highlights li::marker {
    color: var(--primary-color);
}

/* Order Section */
.order {
    background-color: var(--bg-white);
}

.order-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.steps {
    margin: 1.5rem 0 2rem 1.5rem;
    color: var(--text-light);
}

.steps li {
    margin-bottom: 0.8rem;
}

.shipping-info-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
}

.shipping-info-card h4 {
    margin-bottom: 0.5rem;
}

.shipping-info-card p {
    color: var(--text-light);
}

/* Forms */
.styled-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.max-form {
    max-width: 800px;
    margin: 0 auto;
}

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

.form-row .form-group {
    margin-bottom: 0;
}

.full-width {
    grid-column: 1 / -1;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.req {
    color: var(--error-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-main);
    transition: var(--transition);
    background-color: var(--bg-white);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.order-summary {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.summary-row.total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.submit-btn {
    width: 100%;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
    text-align: center;
    font-weight: 600;
}

.form-message.success {
    display: block;
    background-color: #d1fae5;
    color: var(--success-color);
    border: 1px solid #10b981;
}

.form-message.error {
    display: block;
    background-color: #fee2e2;
    color: var(--error-color);
    border: 1px solid #ef4444;
}

/* Footer */
.footer {
    position: relative;
    background-image: url('../images/malta-header.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--bg-white);
    text-align: center;
    padding: 4.5rem 0;
}

/* reCAPTCHA Badge Hiding */
.grecaptcha-badge {
    visibility: hidden;
}

.recaptcha-disclosure {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 1rem;
    text-align: center;
    line-height: 1.4;
}

.recaptcha-disclosure a {
    color: var(--text-light);
    text-decoration: underline;
}

.footer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.footer-content {
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.footer-note {
    color: var(--bg-white);
    font-size: 0.8rem;
    margin-top: 0.8rem;
}

.footer-note a {
    color: var(--bg-white);
}

.footer-note a:hover {
    opacity: 0.8;
}

.footer-links a {
    color: white;
    margin: 0 10px;
}

.footer-links a:hover {
    opacity: 0.8;
}

.legal-text h3 {
    margin: 2rem 0 1rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.legal-text p {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.legal-text ul {
    margin: 1rem 0 2rem 1.5rem;
}

.legal-text li {
    margin-bottom: 0.5rem;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 50px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
    /* hidden by default */
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1000;
}

.scroll-top-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px);
}

.scroll-top-btn.show {
    display: flex;
}

/* Responsiveness */
@media (max-width: 900px) {
    .navbar.home-nav {
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .navbar.home-nav.is-visible {
        transform: translateY(0);
    }

    /* Navbar adjustments */
    .nav-content {
        height: 60px;
        position: relative;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
        padding: 1rem 0;
        gap: 0;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        margin: 0;
        padding: 1rem;
        text-align: center;
        width: 100%;
        font-size: 1.3rem;
    }

    /* Grid and Layouts */
    .about-grid,
    .product-details,
    .order-wrapper {
        grid-template-columns: 1fr;
    }

    .product-details {
        display: flex;
        flex-direction: column-reverse;
        gap: 2rem;
        padding: 1.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "image"
            "text"
            "buttons";
        gap: 0.8rem;
    }

    .hero {
        align-items: flex-start;
        padding-top: 1rem;
        height: auto;
        min-height: 100vh;
        top: 0;
        /* Account for navbar */
    }

    .hero-text {
        text-align: center;
        align-self: end;
        /* Adjusted to better stack */
        margin-top: 0rem;
    }

    .book-title {
        font-size: 3rem;
    }

    .about-btn {
        display: none;
    }

    .hero-subtext {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .hero-image {
        justify-content: center;
        align-self: center;
    }

    .hero-book-cover {
        max-height: 45vh;
        /* Shrink to fit viewport */
        width: auto;
    }

    .cta-buttons {
        justify-content: center;
        align-self: start;
        flex-direction: row !important;
        /* same line */
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .book-title {
        font-size: 2.7rem;
    }

    .product-title {
        font-size: 1.9rem;
    }

    .hero-subtext {
        font-size: 1.2rem;
    }

    .cta-buttons {
        gap: 0.5rem;
    }

    .cta-buttons .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .buy-btn {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .scroll-top-btn {
        bottom: 20px;
        right: 15px;
    }
}