/* Global Styles & Variables */
:root {
    --primary-color: #f36b22;
    /* Orange */
    --secondary-color: #004768;
    /* Deep Blue */
    --text-color: #333;
    --light-gray: #f9f9f9;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--light-gray);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s;
}

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

.btn-primary:hover {
    background: #d85a18;
}

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

.btn-secondary:hover {
    background: #00334d;
}

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

.flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

/* Header Structure */
header {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.top-bar {
    background: var(--secondary-color);
    color: var(--white);
    font-size: 0.85rem;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
}

.top-bar a {
    color: var(--white);
    margin-left: 20px;
}

.main-header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: -1px;
}

.brand-logo span {
    color: var(--primary-color);
}

.search-bar-container {
    flex: 1;
    max-width: 600px;
    margin: 0 40px;
    position: relative;
}

.search-bar-container form {
    display: flex;
}

.search-bar-container input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--secondary-color);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    outline: none;
}

.search-bar-container button {
    background: var(--secondary-color);
    color: var(--white);
    padding: 0 25px;
    border: 2px solid var(--secondary-color);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon-item {
    text-align: center;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.header-icon-item i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.main-nav {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.main-nav ul {
    display: flex;
}

.main-nav li a {
    display: block;
    padding: 15px 20px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
}

.main-nav li a:hover {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 30px;
        margin: 40px 0;
    }
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--border-color);
}

.product-image {
    position: relative;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #fff;
}

.product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 80%;
    max-width: 80%;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: translate(-50%, -50%) scale(1.05);
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

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

/* Toolbar options */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toolbar select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    width: auto;
    margin-bottom: 0;
}

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #666;
    font-size: 0.95rem;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .search-bar-container {
        width: 100%;
        margin: 10px 0;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}