/* ===================================================== */
/* RESET & BASE STYLES */
/* ===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

/* ===================================================== */
/* HEADER */
/* ===================================================== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #161617;
    color: #f5f5f7;
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-button {
    font-size: 20px;
    color: #f5f5f7;
    padding: 4px 8px;
    border-radius: 4px;
}

.menu-button:hover {
    background-color: #2d2d2d;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: #0071e3;
}

/* SEARCH */

.search {
    position: relative;
    flex-grow: 1;
    max-width: 480px;
    margin: 0 20px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 6px 12px;
}

.search-icon {
    font-size: 16px;
    color: #86868b;
    margin-right: 8px;
}

.search-input-wrapper input {
    width: 100%;
    background: none;
    border: none;
    color: #fff;
    outline: none;
    font-size: 14px;
}

.search-input-wrapper input::placeholder {
    color: #86868b;
}

.search-clear {
    color: #86868b;
    font-size: 16px;
    display: none;
}

.search-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1d1d1f;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    padding: 16px;
    margin-top: 4px;
}

.popular-searches h3 {
    font-size: 12px;
    color: #86868b;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.popular-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.popular-list button {
    background-color: #2d2d2d;
    color: #e8e8ed;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    transition: background-color 0.2s;
}

.popular-list button:hover {
    background-color: #0071e3;
    color: #fff;
}

/* HEADER RIGHT */

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #f5f5f7;
}

.phone-dropdown {
    position: relative;
}

.phone-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #1d1d1f;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    margin-top: 8px;
}

.phone-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: #f5f5f7;
}

.phone-menu a:hover {
    background-color: #2d2d2d;
}

.phone-dropdown:hover .phone-menu {
    display: block;
}

/* ===================================================== */
/* SIDE MENU */
/* ===================================================== */

.side-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.side-menu nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.side-menu nav a {
    padding: 12px 20px;
    font-size: 15px;
    color: #1d1d1f;
    transition: background 0.2s;
}

.side-menu nav a:hover,
.side-menu nav a.active {
    background-color: #f0f0f2;
    color: #0071e3;
    font-weight: 600;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ===================================================== */
/* CATALOG */
/* ===================================================== */

.catalog {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.catalog-heading {
    text-align: center;
    margin-bottom: 40px;
}

.catalog-heading span {
    font-size: 12px;
    font-weight: 600;
    color: #86868b;
    letter-spacing: 1px;
}

.catalog-heading h1 {
    font-size: 36px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 8px 0;
}

.catalog-heading p {
    font-size: 16px;
    color: #86868b;
}

/* PRODUCTS GRID */

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stock {
    font-size: 12px;
    color: #34c759;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-card h2 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #1d1d1f;
    margin-bottom: 8px;
    height: 40px;
    overflow: hidden;
}

.product-card p {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 12px;
    flex-grow: 1;
}

.models {
    display: inline-block;
    align-self: flex-start;
    background-color: #f2f2f7;
    color: #1d1d1f;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.price {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 16px;
}

.buy-button {
    width: 100%;
    background-color: #0071e3;
    color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.buy-button:hover {
    background-color: #0077ed;
}

/* ===================================================== */
/* FOOTER */
/* ===================================================== */

footer {
    background-color: #161617;
    color: #86868b;
    padding: 40px 20px;
    margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 100%;
}

.footer-column {
    max-width: 1200px;
}

.footer-logo {
    font-size: 18px;
    font-weight: 700;
    color: #f5f5f7;
    margin-bottom: 10px;
}

.footer-logo span {
    color: #0071e3;
}

.footer-column h3 {
    font-size: 14px;
    color: #f5f5f7;
    margin-bottom: 12px;
}

.footer-column a,
.footer-column p {
    display: block;
    font-size: 13px;
    color: #86868b;
    margin-bottom: 8px;
}

.footer-column a:hover {
    color: #f5f5f7;
}

/* ===================================================== */
/* RESPONSIVE */
/* ===================================================== */

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .search {
        margin: 0 10px;
    }

    .header-icon span {
        display: none;
    }

    .catalog-heading h1 {
        font-size: 28px;
    }
}