/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --orange: #e65100;
    --orange-light: #ff6d00;
    --orange-dark: #bf360c;
    --dark: #212121;
    --dark-light: #424242;
    --gray: #757575;
    --gray-light: #e0e0e0;
    --gray-bg: #f5f5f5;
    --white: #ffffff;
    --green: #2e7d32;
    --red: #c62828;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Header === */
.site-header {
    background: var(--dark);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
}
.logo:hover { color: var(--white); }
.logo-icon { font-size: 1.6rem; }
.logo-dot { color: var(--orange); }

.search-form {
    flex: 1;
    max-width: 500px;
    display: flex;
    background: var(--dark-light);
    border-radius: var(--radius);
    overflow: hidden;
}
.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--white);
    padding: 10px 16px;
    font-size: 0.95rem;
    outline: none;
}
.search-form input::placeholder { color: #999; }
.search-form button {
    border: none;
    background: var(--orange);
    color: var(--white);
    padding: 10px 16px;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition);
}
.search-form button:hover { background: var(--orange-dark); }

.header-nav { display: flex; align-items: center; }

.cart-link {
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.cart-link:hover { background: var(--dark-light); color: var(--white); }

.cart-badge {
    background: var(--orange);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle {
    display: none;
    border: none;
    background: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

.category-nav {
    background: var(--dark-light);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.category-nav-list {
    display: flex;
    list-style: none;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-nav-list::-webkit-scrollbar { display: none; }
.category-nav-list a {
    display: block;
    padding: 10px 16px;
    color: #ccc;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: all var(--transition);
}
.category-nav-list a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--orange-dark), var(--orange));
    color: var(--white);
    padding: 80px 20px;
    text-align: center;
}
.hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}
.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); color: var(--white); }
.btn-secondary { background: var(--gray-light); color: var(--dark); }
.btn-secondary:hover { background: #ccc; color: var(--dark); }
.btn-success { background: var(--green); color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* === Sections === */
.section { padding: 60px 0; }
.section-alt { background: var(--gray-bg); }
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

/* === Category Grid === */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: all var(--transition);
    color: var(--dark);
}
.category-card:hover {
    border-color: var(--orange);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: var(--dark);
}
.category-card-icon { font-size: 2.4rem; margin-bottom: 12px; }
.category-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.category-card p { font-size: 0.85rem; color: var(--gray); line-height: 1.4; }

/* === Product Grid === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.product-card-image {
    display: block;
    position: relative;
    background: var(--gray-bg);
    aspect-ratio: 1;
    overflow: hidden;
    padding: 16px;
}
.product-card-image svg { width: 100%; height: 100%; }

.product-card-body { padding: 16px; }

.product-card-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.3;
}
.product-card-title:hover { color: var(--orange); }

.product-card-price { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.price-old {
    text-decoration: line-through;
    color: var(--gray);
    font-size: 0.85rem;
}
.price-current {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--orange-dark);
}
.price-old-lg { font-size: 1rem; }
.price-current-lg { font-size: 1.6rem; }

.product-card-stock {
    font-size: 0.8rem;
    margin-bottom: 12px;
}
.in-stock { color: var(--green); }
.out-of-stock { color: var(--red); }

/* === Badges === */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-sale {
    background: var(--red);
    color: var(--white);
    position: absolute;
    top: 12px;
    left: 12px;
}
.badge-lg { font-size: 0.85rem; padding: 6px 14px; }
.badge-discount { background: var(--green); color: var(--white); }

/* === Product Detail === */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.product-detail-image {
    background: var(--gray-bg);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-detail-image svg { max-height: 400px; }
.product-detail-info h1 { font-size: 1.8rem; margin-bottom: 8px; }
.product-detail-category { color: var(--gray); margin-bottom: 20px; font-size: 0.95rem; }
.product-detail-price { margin-bottom: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product-detail-stock { margin-bottom: 20px; font-weight: 500; }
.product-detail-desc { margin-bottom: 24px; color: var(--dark-light); line-height: 1.7; }

.product-detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 32px;
}

.quantity-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    overflow: hidden;
}
.quantity-input input {
    width: 56px;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 4px;
    font-family: inherit;
    -moz-appearance: textfield;
}
.quantity-input input::-webkit-inner-spin-button,
.quantity-input input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-btn {
    border: none;
    background: var(--gray-bg);
    width: 40px;
    height: 42px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background var(--transition);
    font-family: inherit;
}
.qty-btn:hover { background: var(--gray-light); }
.quantity-input-sm input { width: 44px; padding: 6px 2px; font-size: 0.9rem; }
.quantity-input-sm .qty-btn { width: 32px; height: 34px; font-size: 1rem; }

/* === Specs Table === */
.product-specs { margin-top: 8px; }
.product-specs h2 { font-size: 1.2rem; margin-bottom: 12px; }
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table th,
.specs-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
}
.specs-table th {
    font-weight: 600;
    width: 40%;
    color: var(--gray);
    background: var(--gray-bg);
}

/* === Breadcrumb === */
.breadcrumb {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--gray);
}
.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--orange); }

/* === Toolbar === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}
.toolbar-count { color: var(--gray); font-size: 0.9rem; }
.toolbar-sort { display: flex; align-items: center; gap: 8px; }
.toolbar-sort label { font-size: 0.9rem; color: var(--gray); }
.toolbar-sort select {
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
    cursor: pointer;
}

/* === Category Header === */
.category-header {
    margin-bottom: 24px;
}
.category-header h1 { font-size: 1.8rem; margin-bottom: 8px; }
.category-header p { color: var(--gray); max-width: 700px; }

/* === Cart === */
.cart-table-wrapper { overflow-x: auto; }
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
}
.cart-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--gray-light);
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
}
.cart-product a { font-weight: 600; color: var(--dark); }
.cart-product a:hover { color: var(--orange); }
.cart-price { white-space: nowrap; }
.cart-subtotal { font-weight: 600; white-space: nowrap; }
.btn-remove {
    border: none;
    background: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 50%;
    transition: all var(--transition);
}
.btn-remove:hover { color: var(--red); background: #fde; }

.cart-summary {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.cart-total { font-size: 1.1rem; }
.cart-total-amount { font-size: 1.5rem; font-weight: 700; color: var(--orange-dark); margin-left: 12px; }
.cart-actions { display: flex; gap: 12px; }

/* === Checkout === */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: start;
}
.checkout-form h2 { font-size: 1.2rem; margin: 24px 0 16px; }
.checkout-form h2:first-child { margin-top: 0; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition);
}
.form-group input:focus { outline: none; border-color: var(--orange); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.checkout-summary {
    background: var(--gray-bg);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 120px;
}
.checkout-summary h2 { font-size: 1.1rem; margin-bottom: 16px; }
.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
    font-size: 0.9rem;
    gap: 12px;
}
.checkout-item-name { flex: 1; }
.checkout-item-qty { color: var(--gray); }
.checkout-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.alert { padding: 16px; border-radius: var(--radius); margin-bottom: 24px; }
.alert-error { background: #fde; border: 1px solid #fcc; color: var(--red); }
.alert ul { margin-left: 20px; }

/* === Order Success === */
.order-success {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
}
.order-success h1 { margin-bottom: 16px; }
.order-success p { margin-bottom: 12px; color: var(--gray); }
.order-success .btn { margin-top: 24px; }

/* === USPs === */
.usps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    text-align: center;
}
.usp-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.usp h3 { font-size: 1rem; margin-bottom: 4px; }
.usp p { font-size: 0.85rem; color: var(--gray); }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}
.empty-state p { margin-bottom: 20px; font-size: 1.1rem; }

/* === Footer === */
.site-footer {
    background: var(--dark);
    color: #ccc;
    padding: 48px 0 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding-bottom: 32px;
}
.footer-col h3 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 16px;
}
.footer-col p { font-size: 0.85rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #aaa; font-size: 0.85rem; }
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    color: #777;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .usps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .search-form { display: none; }
    .mobile-menu-toggle { display: block; }
    .header-nav { margin-left: auto; }

    .category-nav { display: none; }
    .category-nav.open { display: block; }
    .category-nav-list { flex-direction: column; padding: 8px 0; }
    .category-nav-list a { padding: 12px 20px; }

    .hero { padding: 48px 20px; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }

    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .product-detail { grid-template-columns: 1fr; gap: 24px; }
    .product-detail-image { aspect-ratio: auto; max-height: 300px; }

    .checkout-layout { grid-template-columns: 1fr; gap: 24px; }
    .checkout-summary { position: static; }

    .cart-summary { flex-direction: column; align-items: stretch; text-align: center; }
    .cart-actions { justify-content: center; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .usps { grid-template-columns: 1fr 1fr; gap: 20px; }

    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .category-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .product-card-body { padding: 12px; }
    .product-card-title { font-size: 0.85rem; }
    .price-current { font-size: 1rem; }
    .usps { grid-template-columns: 1fr; }
}
