/* =============================================
   STYLE.CSS - Common Styles for All Pages
   ============================================= */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: #f0f2f5;
    color: #1a1a2e;
    padding-bottom: 70px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 12px;
}

a {
    text-decoration: none;
}

/* ===== HEADER ===== */
.main-header {
    background: #131921;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #232f3e;
}

.main-header .container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    max-width: 480px;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.2rem;
    color: #ffb347;
}

.logo h1 span {
    color: #fff;
    font-weight: 300;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    flex: 1;
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.search-bar input {
    border: none;
    padding: 6px 10px;
    flex: 1;
    font-size: 0.85rem;
    outline: none;
    min-width: 60px;
}

.search-bar button {
    background: #ffb347;
    border: none;
    padding: 6px 12px;
    color: #131921;
    cursor: pointer;
}

/* ===== HEADER ICONS ===== */
.header-icons {
    display: flex;
    gap: 12px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.header-icons a {
    color: #fff;
    position: relative;
    text-decoration: none;
}

.badge-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffb347;
    color: #131921;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 50%;
}

/* ===== CATEGORY NAVIGATION ===== */
.cat-nav {
    background: #232f3e;
    padding: 6px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.cat-nav .container {
    display: flex;
    gap: 12px;
    padding: 0 12px;
    max-width: 480px;
    overflow-x: auto;
}

.cat-nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cat-nav a i {
    font-size: 0.7rem;
    color: #ffb347;
}

.cat-nav a:hover {
    color: #fff;
}

.cat-nav a.active {
    color: #ffb347;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: 0.2s;
}

.product-card:active {
    transform: scale(0.98);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ===== PRODUCT IMAGE ===== */
.product-img {
    background: #f7f8fa;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-img .no-image {
    font-size: 2.5rem;
    color: #ccc;
}

.product-img .brand-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(19, 25, 33, 0.85);
    color: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.product-img .featured-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #ffb347;
    color: #131921;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== PRODUCT INFO ===== */
.product-info {
    padding: 8px 10px 10px;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.6em;
}

.product-cat {
    font-size: 0.6rem;
    color: #888;
    text-transform: uppercase;
}

.product-price {
    font-weight: 700;
    font-size: 1rem;
    margin: 4px 0;
}

.product-price small {
    font-weight: 400;
    font-size: 0.65rem;
    color: #888;
    text-decoration: line-through;
    margin-left: 4px;
}

.product-stock {
    font-size: 0.65rem;
}

.product-stock.in {
    color: #28a745;
}

.product-stock.out {
    color: #dc3545;
}

/* ===== MOBILE FOOTER ===== */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #131921;
    border-top: 1px solid #232f3e;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 8px;
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-footer a {
    color: #888;
    text-decoration: none;
    text-align: center;
    font-size: 0.55rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
}

.mobile-footer a i {
    font-size: 1.2rem;
}

.mobile-footer a.active {
    color: #ffb347;
}

.mobile-footer a:hover {
    color: #fff;
}

.mobile-footer a .badge {
    background: #ffb347;
    color: #131921;
    border-radius: 50%;
    padding: 0 5px;
    font-size: 0.5rem;
    font-weight: 700;
    margin-left: 2px;
}

/* ===== PAGE FOOTER ===== */
.footer {
    background: #0b1a2f;
    color: #b6c9e8;
    padding: 40px 0 24px;
    border-radius: 40px 40px 0 0;
    margin-top: 30px;
}

.footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.footer-col a {
    display: block;
    color: #b6c9e8;
    text-decoration: none;
    margin: 6px 0;
    font-size: 0.8rem;
    transition: 0.2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-col a i {
    margin-right: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85rem;
    transition: 0.2s;
}

.btn-primary {
    background: #131921;
    color: #fff;
}

.btn-primary:hover {
    background: #232f3e;
}

.btn-success {
    background: #ffb347;
    color: #131921;
}

.btn-success:hover {
    background: #fcaa2f;
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    color: #131921;
    border: 1px solid #ddd;
}

.btn-outline:hover {
    background: #f5f5f5;
}

.btn-block {
    width: 100%;
    text-align: center;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.7rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 0.85rem;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* ===== BACK LINK ===== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 10px 0;
}

.back-link:hover {
    color: #131921;
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
    .container {
        max-width: 640px;
    }
    .main-header .container {
        max-width: 640px;
    }
    .cat-nav .container {
        max-width: 640px;
    }
    .mobile-footer {
        max-width: 640px;
    }
    .footer .container {
        max-width: 640px;
    }
    .product-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 960px;
    }
    .main-header .container {
        max-width: 960px;
    }
    .cat-nav .container {
        max-width: 960px;
    }
    .mobile-footer {
        max-width: 960px;
    }
    .footer .container {
        max-width: 960px;
    }
    .product-grid {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}