/* ========================
   COLOR PALETTE
======================== */
:root {
    --deep-blue: #1E2D4F;
    --red: #B35C5C;
    --off-white: #FAFAF5;
    --gray: #CCCCCC;
    --text-dark: #1E2D4F;
    --text-light: #FAFAF5;
}

/* ========================
   GLOBAL STYLES
======================== */
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main, .products, .categories, .hero {
    flex: 1;
}

a {
    text-decoration: none;
    transition: all 0.25s ease;
}

/* ========================
   HEADER
======================== */
header {
    background: var(--deep-blue);
    color: var(--text-light);
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* Logo on the left */
.logo {
    font-weight: bold;
    font-size: 20px;
}

/* Navigation centered */
nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--text-light);
    font-weight: 500;
}

nav a:hover {
    color: var(--red);
}

/* ========================
   HERO
======================== */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 80px 40px;
    background: var(--off-white);
}

.hero-text h1 {
    font-size: 44px;
    margin-bottom: 20px;
    color: var(--deep-blue);
}

.hero-text p {
    max-width: 420px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.btn-primary {
    background: var(--deep-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    margin-right: 10px;
}

.btn-primary:hover {
    background: #273960;
}

.btn-secondary {
    background: var(--red);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
}

.btn-secondary:hover {
    background: #c36e6e;
}

.hero-image {
    width: 420px;
    height: 280px;
    background: var(--gray);
    border-radius: 8px;
}

/* ========================
   FEATURED CATEGORIES
======================== */
.categories {
    padding: 60px 40px;
    text-align: center;
}

.categories h2 {
    font-size: 32px;
    margin-bottom: 30px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adjust min-width for better spacing */
    gap: 24px;
    justify-items: center; /* Center cards inside their grid cells */
}

.category-card {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: 16px;
    font-weight: 600;
    background: white;
    border: 1px solid var(--gray);
    border-radius: 6px;
    text-align: center;
    transition: all 0.25s ease;

    /* REMOVE BLUE LINK STYLING */
    text-decoration: none;
    color: var(--text-dark);   /* or #000 */
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border-color: var(--deep-blue);
    color: var(--deep-blue);   /* optional: match hover border color */
}



/* ========================
   PRODUCT GRID
======================== */
.products {
    padding: 60px 40px;
}

.products h2 {
    font-size: 32px;
    margin-bottom: 30px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--gray);
    padding: 20px;
    border-radius: 6px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

#main-image {
    width: 100%;
    max-height: 500px; /* ensures it never exceeds container height */
    aspect-ratio: 1 / 1; /* keeps square aspect */
    background-size: contain; /* prevents image from being cropped */
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transition: background-image 0.3s ease-in-out, transform 0.3s ease;
}


#main-image:hover {
    transform: scale(1.02); /* optional subtle zoom */
}


.product-card:hover .product-img {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.product-brand {
    font-size: 14px;
    color: var(--deep-blue);
    font-weight: 500;
}

.product-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    margin-left: 40px; /* moves it slightly to the right */
}


.outline-btn {
    border: 2px solid var(--deep-blue);
    padding: 8px 12px;
    display: inline-block;
    color: var(--deep-blue);
    border-radius: 4px;
}

.outline-btn:hover {
    background: rgba(30,45,79,0.1);
}

/* ========================
   FOOTER
======================== */
footer {
    background: var(--deep-blue);
    color: var(--text-light);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    clear: both;
}

footer a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    color: var(--red);
}

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-image {
        width: 100%;
        height: 220px;
        margin-top: 20px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}
/* =========================
   PRODUCT DETAIL PAGE
========================= */
/* =========================
   PRODUCT DETAIL PAGE
========================= */
.product-detail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 60px 40px;
    max-width: 1000px;
    margin: 0 auto;
    font-family: Arial, Helvetica, sans-serif;
}

/* IMAGE SECTION */
.product-images {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

/* MAIN IMAGE */
#main-image {
    width: 100%;
    max-height: 500px;
    aspect-ratio: 1 / 1; /* keep square */
    background-size: contain; /* fit inside without cropping */
    background-repeat: no-repeat;
    background-position: center center; /* vertical + horizontal centering */
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    transition: background-image 0.3s ease-in-out, transform 0.3s ease;
}

#main-image:hover {
    transform: scale(1.02); /* optional zoom on hover */
}

/* THUMBNAILS */
#thumbnail-container {
    display: flex;
    flex-wrap: wrap; /* wrap thumbnails instead of scrolling */
    gap: 10px;
    margin-top: 12px;
    align-items: center; /* vertically center thumbnails */
    justify-content: flex-start; /* left-align thumbnails */
    overflow: visible; /* no horizontal scroll */
}

.thumbnail {
    width: 60px;
    height: 60px;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.thumbnail:hover {
    transform: scale(1.1);
    border-color: var(--deep-blue);
}

.thumbnail.active {
    border-color: var(--red);
    transform: scale(1.1); /* match hover without moving layout */
}

/* PRODUCT INFO SECTION */
.product-info {
    flex: 1;
    min-width: 300px;
    max-width: 550px;
    padding-left: 15px; /* shift slightly right */
}

.product-brand {
    color: var(--deep-blue);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px; /* reduced spacing */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    margin-left: 5px; /* slight right shift */
}

.product-description,
.product-details,
.product-links {
    margin-bottom: 30px;
}

.product-description h3,
.product-details h3,
.product-links h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--deep-blue);
    border-bottom: 2px solid var(--gray);
    display: inline-block;
    padding-bottom: 4px;
}

.product-description p,
.product-details ul,
.product-links ul {
    font-size: 16px;
    line-height: 1.6;
}

.product-details ul,
.product-links ul {
    padding-left: 20px;
}

.product-links a {
    color: var(--deep-blue);
    text-decoration: none;
    font-weight: 500;
}

.product-links a:hover {
    color: var(--red);
    text-decoration: underline;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .product-detail {
        flex-direction: column;
        gap: 30px;
        padding: 40px 20px;
    }

    #main-image {
        max-height: 400px;
    }

    #thumbnail-container {
        justify-content: center;
    }
}

/* --- FIX: Thumbnail should not jump upward when active --- */
.thumbnail,
.thumbnail.active {
  transform-origin: center center !important;  /* prevent upward shift */
  vertical-align: middle !important;           /* prevent baseline pushing */
}

/* Prevent active thumbnail from enlarging the layout (keeps size consistent) */
.thumbnail.active {
  transform: scale(1.08) translateY(0) !important;
}

/* Ensure thumbnail container never crops raised thumbnails */
#thumbnail-container {
  overflow: visible !important;
  display: flex;
  flex-wrap: wrap;              /* stops horizontal scrolling */
  gap: 10px;
  align-items: center;
}

/* Keep main image from shifting when thumbnails animate */
#main-image {
  overflow: visible !important; 
}

/* ========================
   PRODUCT CARDS (Homepage)
======================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    padding: 0; /* spacing handled by container */
}

.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: white;
    border: 1px solid var(--gray);
    padding: 16px;
    border-radius: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-align: center;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.product-card .product-img {
    width: 100%;
    padding-top: 100%; /* square aspect ratio */
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-card .product-brand {
    font-size: 14px;
    color: var(--deep-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-card .product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.product-card .outline-btn {
    margin-top: 8px;
    border: 2px solid var(--deep-blue);
    padding: 8px 16px;
    border-radius: 4px;
    color: var(--deep-blue);
    font-weight: 500;
    transition: background 0.25s ease;
}

.product-card .outline-btn:hover {
    background: rgba(30,45,79,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
    }

    .product-card {
        padding: 12px;
    }

    .product-card .product-name {
        font-size: 14px;
    }

    .product-card .product-brand {
        font-size: 12px;
    }

    .product-card .outline-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
}

.search-section {
    padding: 40px;
    text-align: center;
}

#search-input {
    width: 100%;
    max-width: 420px;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--gray);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
}

#search-input:focus {
    border-color: var(--deep-blue);
}
