/* =======================
   GLOBAL
======================= */
* {
    box-sizing: border-box;
}

:root {
    --bg-light: #f5f5f5;
    --card-light: #ffffff;
    --text-light: #111111;
    --muted-light: #666666;
    --border-light: #e7e7e7;

    --bg-dark: #121212;
    --card-dark: #1a1a1a;
    --text-dark: #f0f0f0;
    --muted-dark: #bdbdbd;
    --border-dark: #333333;

    --brand: #c7db14;
    --brand-hover: #a0b30f;
    --black: #000000;
    --white: #ffffff;

    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 14px 28px rgba(0, 0, 0, 0.14);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    text-align: center;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

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

.hidden {
    display: none !important;
}

/* =======================
   HEADER
======================= */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    color: var(--white);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 1.05rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
}

.logo {
    font-weight: 800;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.header a {
    color: var(--white);
    margin: 0 6px;
    text-decoration: none;
    position: relative;
    transition: color 0.3s, transform 0.3s;
    padding: 4px 2px;
}

.header a::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--brand);
    left: 0;
    bottom: -3px;
    transition: width 0.3s ease;
}

.header a:hover {
    color: var(--brand);
    transform: translateY(-1px);
}

.header a:hover::after {
    width: 100%;
}

/* =======================
   SEARCH BOX
======================= */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    padding: 5px;
}

.search-box input {
    padding: 10px 14px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--white);
    min-width: 220px;
    width: 220px;
    max-width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: #a8a8a8;
}

/* Search button stays exactly the same */
.search-box button {
    padding: 10px 14px;
    border-radius: 999px;
    border: none;
    background: var(--brand);
    color: var(--black);
    cursor: pointer;
    font-size: 16px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.search-box button:hover {
    background: var(--brand-hover);
    color: var(--black);
}

#darkModeToggle {
    min-width: 46px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =======================
   SEARCH SUGGESTIONS
======================= */
.suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 220px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    z-index: 2000;
    max-height: 240px;
    overflow-y: auto;
    text-align: left;
    padding: 6px 0;
}

.suggestions-box.hidden {
    display: none !important;
}

.suggestion-item {
    padding: 11px 14px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-item:hover {
    background: #f2f2f2;
    color: var(--text-light);
}

/* =======================
   HERO
======================= */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 72vh;
    padding: 90px 20px;
    color: var(--white);
    text-align: center;
    background-image: url("images/logo.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65));
}

.hero * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    margin: 0 0 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.hero p {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    margin: 0 0 24px;
    max-width: 640px;
    color: rgba(255, 255, 255, 0.92);
}

.hero .btn {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

/* =======================
   CONTAINER
======================= */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 18px;
}

/* =======================
   CATEGORIES
======================= */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    padding: 32px 15px 20px;
}

.category {
    padding: 12px 22px;
    border-radius: 999px;
    background-color: #ececec;
    cursor: pointer;
    user-select: none;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
    color: var(--text-light);
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.category:hover {
    transform: translateY(-2px);
    background-color: var(--brand);
    color: var(--black);
    box-shadow: var(--shadow-soft);
}

.category.active {
    background-color: var(--black);
    color: var(--white);
}

/* =======================
   PRODUCTS GRID
======================= */
.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    padding: 30px 4px 50px;
}

.product {
    background: var(--card-light);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow-soft);
    text-align: center;
    color: var(--text-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border-light);
}

.product:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.product img {
    width: 100%;
    max-width: 240px;
    height: 260px;
    object-fit: cover;
    border-radius: 14px;
    margin: 0 auto;
}

.product h3,
.product p,
.slide h4,
.slide p {
    transition: color 0.3s ease;
    word-wrap: break-word;
}

.product h3 {
    margin: 14px 0 8px;
    font-size: 1.03rem;
    font-weight: 700;
}

.product p,
.slide p {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--muted-light);
}

.slide h4 {
    margin: 14px 0 8px;
    font-size: 1rem;
}

/* =======================
   SLIDESHOW
======================= */
.slideshow-container {
    position: relative;
}

.slide {
    display: none;
}

.slide.active-slide {
    display: block;
}

.slide-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 4px;
    flex-wrap: wrap;
}

.slide-controls button {
    background: var(--black);
    color: var(--white);
    border: none;
    padding: 9px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}

.slide-controls button:hover {
    background: var(--brand);
    color: var(--black);
    opacity: 1;
}

.product button.add-btn {
    background: var(--black);
    color: var(--white);
    border: none;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 12px;
    width: 100%;
    font-weight: 700;
}

/* =======================
   GENERAL BUTTONS
======================= */
button,
.btn,
a.btn {
    padding: 12px 18px;
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, transform 0.2s, border 0.3s;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
}

button:hover,
.btn:hover,
a.btn:hover {
    background: var(--brand);
    color: var(--black);
    transform: translateY(-1px);
}

/* =======================
   CART PAGE
======================= */
.container h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-light);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
}

#cartTable {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: var(--card-light);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    color: var(--text-light);
}

#cartTable th,
#cartTable td {
    padding: 15px 20px;
    text-align: left;
}

#cartTable th {
    background: var(--black);
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

#cartTable tr:nth-child(even) {
    background: #fafafa;
}

#cartTable tr:hover {
    background: #f1f1f1;
}

#cartTable td button {
    padding: 8px 12px;
    background: var(--brand);
    color: var(--black);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 700;
}

#cartTable td button:hover {
    background: var(--brand-hover);
}

#total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
    margin-top: 10px;
}

/* =======================
   FOOTER
======================= */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 18px 15px;
    margin-top: 40px;
}

/* =======================
   ANIMATIONS
======================= */
.fade-in {
    animation: fade 1.1s ease;
}

.slide-up {
    animation: slideUp 0.9s ease;
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(35px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =======================
   DARK MODE
======================= */
body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body.dark-mode .header,
body.dark-mode .footer {
    background-color: #1b1b1b;
    color: var(--text-dark);
}

body.dark-mode .header a {
    color: var(--text-dark);
}

body.dark-mode .search-box {
    background: #181818;
    border: 1px solid #2d2d2d;
}

body.dark-mode .search-box input {
    background: transparent;
    color: var(--text-dark);
}

body.dark-mode .search-box input::placeholder {
    color: #9f9f9f;
}

body.dark-mode .search-box button {
    background: var(--brand);
    color: var(--black);
}

body.dark-mode .search-box button:hover {
    background: var(--brand-hover);
}

body.dark-mode .suggestions-box {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .suggestion-item {
    color: var(--text-dark);
}

body.dark-mode .suggestion-item:hover {
    background: #2a2a2a;
    color: var(--text-dark);
}

body.dark-mode .product {
    background: var(--card-dark);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}

body.dark-mode .product h3,
body.dark-mode .product p,
body.dark-mode .slide h4,
body.dark-mode .slide p,
body.dark-mode .container h1,
body.dark-mode #total {
    color: var(--text-dark);
}

body.dark-mode .product p,
body.dark-mode .slide p {
    color: var(--muted-dark);
}

body.dark-mode .slide-controls button,
body.dark-mode .product button.add-btn {
    background: var(--brand);
    color: var(--black);
}

body.dark-mode .slide-controls button:hover,
body.dark-mode .product button.add-btn:hover {
    background: var(--brand-hover);
    color: var(--black);
}

body.dark-mode .category {
    background-color: #2a2a2a;
    color: var(--text-dark);
    border: 1px solid #353535;
}

body.dark-mode .category.active {
    background-color: var(--brand);
    color: var(--black);
    border-color: var(--brand);
}

body.dark-mode #cartTable {
    background: var(--card-dark);
    color: var(--text-dark);
}

body.dark-mode #cartTable th {
    background: #262626;
}

body.dark-mode #cartTable tr:nth-child(even) {
    background: #202020;
}

body.dark-mode #cartTable tr:hover {
    background: #292929;
}

body.dark-mode button,
body.dark-mode .btn,
body.dark-mode a.btn {
    background: var(--brand);
    color: var(--black);
}

body.dark-mode button:hover,
body.dark-mode .btn:hover,
body.dark-mode a.btn:hover {
    background: var(--brand-hover);
    color: var(--black);
}

body.dark-mode .hero .btn {
    background: var(--brand);
    color: var(--black);
    border: 1px solid var(--brand);
}

body.dark-mode .hero .btn:hover {
    background: var(--white);
    color: var(--black);
    border-color: var(--white);
}

/* =======================
   TABLET
======================= */
@media (max-width: 1000px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
        padding: 28px 4px 40px;
    }

    .header {
        justify-content: center;
        text-align: center;
        padding: 15px 20px;
    }

    .hero {
        min-height: 58vh;
        padding: 65px 15px;
    }
}

/* =======================
   MOBILE
======================= */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        text-align: center;
        padding: 15px;
    }

    .logo {
        font-size: 1rem;
        text-align: center;
        white-space: normal;
    }

    .header nav {
        justify-content: center;
        width: 100%;
    }

    .header a {
        margin: 0 6px;
        font-size: 0.95rem;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
        min-width: unset;
        font-size: 0.95rem;
    }

    .search-box button {
        border-radius: 12px;
        min-width: 52px;
    }

    .suggestions-box {
        width: 100%;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        border-radius: 14px;
    }

    #darkModeToggle {
        width: 100%;
        border-radius: 12px;
    }

    .hero {
        min-height: 46vh;
        padding: 55px 15px;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .categories {
        gap: 10px;
        padding: 20px 10px;
    }

    .category {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .products {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 20px 0 35px;
    }

    .product {
        padding: 15px;
    }

    .product img {
        max-width: 100%;
        height: 220px;
    }

    .slide-controls {
        flex-direction: column;
    }

    .slide-controls button {
        width: 100%;
    }

    button,
    .btn,
    a.btn {
        font-size: 0.95rem;
        padding: 12px 14px;
    }

    .container h1 {
        font-size: 1.4rem;
    }

    #total {
        font-size: 1.2rem;
    }
}