/* --- Global --- */
@import url('https://fonts.cdnfonts.com/css/ackbar');

:root {
    --brand-blue: #002D9C; /* Extracted from your textlogo */
    --brand-purple: #4B0082; /* Extracted from your banner */
    --main-font: 'Ackbar', sans-serif;
    --text-font: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Fallback for body text */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--text-font);
    background-color: #000;
    color: #fff;
    overflow-x: hidden; /* Prevents horizontal scrolling */
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, button, .nav-link, .page-title, .product-name {
    font-family: var(--main-font);
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 1px;
    word-wrap: break-word;
    overflow-wrap: break-word; /* Fixes mobile overflow */
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #eee;
}

img {
    max-width: 100%;
    height: auto;
    /* Prevents blurriness on scale-down */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    text-align: center;
}

.line-break {
    width: 100px;
    height: 2px;
    background-color: #fff;
    margin: 1.5rem auto;
}

.button {
    font-family: var(--main-font);
    background-color: #fff;
    color: #000;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    border-radius: 30px;
}

.button:hover {
    background-color: var(--brand-blue);
    color: #fff;
    transform: scale(1.05);
}

/* --- Header / Banner --- */
.site-header {
    width: 100%;
    height: 100px;
    background-image: url('images/banner.png'); /* CORRECTION: .png */
    background-size: cover; 
    background-position: center;
    background-repeat: repeat;
    
    display: grid; /* CORRECTION: Switched to grid for centering */
    grid-template-columns: 1fr auto 1fr; /* Left, Center, Right */
    align-items: center;
    padding: 0 2%;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid #000;
}

.logo-main-link {
    justify-self: center; /* CORRECTION: Center logo in grid */
    line-height: 0; /* Removes any <a> tag bottom spacing */
}

.logo-main {
    /* --- MODIFICATION: Increased logo height --- */
    height: 70px; 
    width: auto;
}

.logo-menu {
    height: 60px;
    cursor: pointer;
    transition: transform 0.2s;
    justify-self: start; /* CORRECTION: Align to grid start */
}

.logo-menu:hover {
    transform: scale(1.1);
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
    justify-self: end; /* CORRECTION: Align to grid end */
}

.cart-icon-wrapper .cart-icon {
    height: 60px;
}

.cart-icon-wrapper .cart-item-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: red;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--main-font);
    font-size: 0.9rem;
    border: 2px solid #fff;
}

/* --- Overlay Menu --- */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay-menu.active {
    opacity: 1;
    visibility: visible;
}

.overlay-menu nav {
    text-align: center;
}

.overlay-menu .nav-link {
    display: block;
    font-size: 2.5rem;
    color: #fff;
    text-decoration: none;
    margin: 1.5rem 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.overlay-menu .nav-link:hover {
    transform: scale(1.1);
    color: var(--brand-blue);
}

/* --- Home Page --- */
.home-title {
    font-size: 6rem;
    margin-top: 3rem;
}

.product-grid {
    display: grid;
    /* CORRECTION: Set to 3 columns to leave empty space */
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background-color: #111;
    border: 2px solid #fff;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: scale(1.03);
    border-color: var(--brand-blue);
}

.product-card img {
    width: 100%;
    /* aspect-ratio: 1 / 1;  <-- DELETE OR COMMENT OUT THIS LINE */
    /* Add the new 4:3 aspect ratio */
    aspect-ratio: 4 / 3; 
    object-fit: cover;
    background-color: #fff;
}

.product-card .product-info {
    padding: 1rem;
    text-align: left;
}

.product-card .product-name {
    font-size: 1.5rem;
}

.product-card .product-price {
    font-size: 1.2rem;
    color: #ccc;
    margin-top: 0.5rem;
}

/* --- Product Page Zoom Styles --- */
.product-images {
    overflow: hidden; 
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; 
    border: 2px solid #fff; 
    overflow: hidden;
    cursor: zoom-in;
    
    /* These will be set by JS, but good to have defaults */
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0% 0%; /* Start hidden */
}

/* The actual <img> tag */
.product-image-wrapper .main-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none !important; 
    transition: opacity 0.2s ease-out; /* Smooth fade out when zooming */
}

/* Interaction classes */
.product-image-wrapper:hover {
    cursor: zoom-out;
}

/* --- Product Page --- */
.product-page-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.product-images img {
    width: 100%;
    border: 2px solid #fff;
}

.product-details {
    text-align: left;
}

.product-details .product-name {
    font-size: 3rem;
}

.product-details .product-price {
    font-size: 2rem;
    color: #ccc;
    margin: 1rem 0;
}

.product-details .product-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 2rem 0;
}

.product-details .button {
    font-size: 1.5rem;
}

/* --- Form Pages (Custom, Contact) --- */
.page-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: var(--main-font);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-family: var(--text-font);
    border: 2px solid #fff;
    background-color: #111;
    color: #fff;
    border-radius: 5px;
}

.form-group input[type="file"] {
    padding: 0.5rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #777;
}

.form-group .button {
    width: 100%;
    font-size: 1.5rem;
}

#form-error {
    color: red;
    text-align: center;
    margin-bottom: 1rem;
    display: none; /* Hidden by default */
    font-size: 1.1rem;
    line-height: 1.5;
}

/* --- About/FAQ/Social Pages --- */
.static-page-content {
    max-width: 900px;
    text-align: center;
}

.static-page-content h1 {
    font-size: 3rem;
}

.static-page-content p {
    font-size: 1.2rem;
    margin-top: 1rem;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.social-links .button {
    font-size: 1.8rem;
    width: 300px;
}

/* --- Cart Page --- */
.cart-items-list {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.cart-items-list th,
.cart-items-list td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #333;
}

.cart-items-list th {
    font-family: var(--main-font);
    font-size: 1.2rem;
}

.cart-product-details {
    display: flex;
    align-items: center;
}

.cart-product-details img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 1rem;
    border: 1px solid #fff;
}

.cart-product-details .product-name {
    font-size: 1.2rem;
}

.cart-item-remove {
    font-family: var(--text-font);
    background: none;
    border: none;
    color: red;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
}

.cart-item-remove:hover {
    text-decoration: underline;
}

.cart-summary {
    max-width: 500px;
    margin: 2rem auto 0 auto;
    padding: 2rem;
    background-color: #111;
    border: 2px solid #fff;
}

.cart-summary h2 {
    font-family: var(--main-font);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.cart-summary .total-price {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

/* Delivery Check */
.delivery-check {
    margin-bottom: 1.5rem;
}
.delivery-check label {
    display: block;
    font-family: var(--main-font);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-align: left;
}
.delivery-check input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #fff;
    background-color: #333;
    color: #fff;
    margin-bottom: 1.5rem;
}
#postcode-error {
    color: red;
    margin-top: 0.5rem;
    text-align: left;
    display: none;
}

.cart-summary .button {
    width: 100%;
    font-size: 1.5rem;
}

#cart-empty-message {
    font-size: 1.2rem;
    color: #aaa;
    text-align: center;
    padding: 3rem 0;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid #333;
    color: #777;
    font-family: var(--text-font);
}

/* --- Mobile Compatibility --- */
@media (max-width: 900px) {
    /* CORRECTION: Removed redundant .product-grid rule */
    
    .product-page-layout {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}

@media (max-width: 600px) {
    .site-header {
        height: 80px;
        padding: 0 3%;
    }
    .logo-main { height: 45px; }
    .logo-menu { height: 45px; }
    .cart-icon-wrapper .cart-icon { height: 45px; }
    .cart-icon-wrapper .cart-item-count {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .overlay-menu .nav-link {
        font-size: 2rem;
    }

    .container {
        padding: 0 1rem;
    }

    .home-title {
        font-size: 4.5rem;
    }

    /* Mobile layout from MOBILE.png */
    .product-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns for mobile */
        gap: 1rem;
    }
    
    .product-card .product-name {
        font-size: 1.2rem;
    }
    .product-card .product-price {
        font-size: 1rem;
    }
    
    .product-details .product-name {
        font-size: 2.2rem;
    }

    .page-title {
        font-size: 2rem;
    }

    /* CORRECTION: Fix large h1 on mobile static pages */
    .static-page-content h1 {
        font-size: 2.2rem;
    }

    
    
    .social-links .button {
        font-size: 1.5rem;
        width: 100%;
    }
    
    .cart-items-list {
        display: block;
        width: 100%;
    }
    .cart-items-list thead { display: none; }
    .cart-items-list tbody, .cart-items-list tr, .cart-items-list td {
        display: block;
        width: 100%;
    }
    .cart-items-list tr {
        border-bottom: 2px solid #555;
        padding: 1rem 0;
    }
    .cart-items-list td {
        border: none;
        padding: 0.25rem 0;
    }
    .cart-items-list td:first-child { /* Product details */
        padding-bottom: 1rem;
    }
    .cart-items-list td[data-label="Price:"],
    .cart-items-list td[data-label="Remove"] {
        text-align: left;
    }
    .cart-items-list td[data-label="Price:"]:before {
        content: 'Price: ';
        font-weight: bold;
        font-family: var(--main-font);
    }
}

/* Style for "SOLD" text on product grid */
.product-price.sold {
    color: red;
    font-weight: bold;
    font-size: 1.3rem; /* Make it stand out */
}

/* --- Style for SOLD card --- */
.product-card.sold-card {
    opacity: 0.6; /* Fades the card */
}

/* --- Success Page Styles --- */
.purchase-summary {
    max-width: 600px;
    margin: 2rem auto 0 auto;
    padding: 2rem;
    background-color: #111;
    border: 2px solid #fff;
    text-align: left;
}

.purchase-summary h2 {
    font-family: var(--main-font);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.purchase-summary-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1.5rem;
}

.purchase-summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.purchase-summary-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 1rem;
    border: 1px solid #fff;
}

.purchase-summary-item .product-name {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.purchase-summary-item .product-price {
    font-size: 1rem;
    color: #ccc;
}

.purchase-summary .total-price {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #fff;
}

.go-home-btn {
    margin-top: 2rem;
    font-size: 1.5rem;
}

/* --- Loading State --- */
body.page-is-loading .container,
body.page-is-loading .site-footer {
    /* Hide the main content and footer while loading */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

/* Simple CSS Loading Spinner */
.loader {
    border: 5px solid #333; /* Dark part of circle */
    border-top: 5px solid #fff; /* Light part of circle */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    margin-top: -25px; /* (Negative half of height) */
    margin-left: -25px; /* (Negative half of width) */
    z-index: 9998;
    display: none; /* Hidden by default */
}

body.page-is-loading .loader {
    display: block; /* Show loader only when page is loading */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}