/* style.css - MASTER FILE (Includes Layout + Forms + Tables) */

:root {
    --primary: #ff6a00;       /* Alibaba Orange */
    --primary-hover: #e65e00;
    --dark: #222;
    --text-color: #333;
    --light-bg: #f2f3f7;
    --white: #fff;
    --border-color: #e2e2e2;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: var(--light-bg); color: var(--text-color); line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- LAYOUT UTILITIES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* --- HEADER --- */
header { background: var(--white); box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.navbar { height: 70px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.8rem; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { font-weight: 600; color: var(--dark); font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary); }
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; }

/* --- FORMS (Fixes Login/Register/Checkout) --- */
.form-group { margin-bottom: 20px; }
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: 0.3s;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 5px rgba(255, 106, 0, 0.2); }

/* Authentication Card Style (Centers the login box) */
.auth-wrapper {
    max-width: 450px;
    margin: 60px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.auth-title { text-align: center; margin-bottom: 30px; font-size: 1.8rem; color: var(--dark); }

/* --- BUTTONS --- */
.btn { display: inline-block; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; text-align: center; transition: 0.3s; }
.btn-primary, .btn-cta { background: var(--primary); color: white; }
.btn-primary:hover, .btn-cta:hover { background: var(--primary-hover); }
.btn-accent { background: #333; color: white; }
.btn-block { display: block; width: 100%; }

/* --- TABLES (Fixes Cart & Admin) --- */
table { width: 100%; border-collapse: collapse; margin-top: 20px; background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
th { background: #333; color: white; padding: 15px; text-align: left; }
td { padding: 15px; border-bottom: 1px solid #eee; }
tr:last-child td { border-bottom: none; }

/* --- HERO SECTION (Home) --- */
.hero-wrapper { display: grid; grid-template-columns: 240px 1fr; gap: 20px; margin-top: 20px; }
.cat-sidebar { background: var(--white); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; height: 400px; }
.cat-sidebar a { display: block; padding: 12px 20px; font-size: 0.9rem; border-bottom: 1px solid #f9f9f9; }
.cat-sidebar a:hover { background: #fff5f0; color: var(--primary); padding-left: 25px; }

.slider { position: relative; height: 400px; border-radius: 8px; overflow: hidden; background: #ddd; box-shadow: var(--shadow); }
.slide { position: absolute; inset: 0; opacity: 0; transition: 0.5s; background-size: cover; background-position: center; display: flex; align-items: center; padding: 60px; }
.slide.active { opacity: 1; }
.slide-content { text-shadow: 0 2px 10px rgba(0,0,0,0.5); color: white; }
.slide-content h2 { font-size: 3rem; margin-bottom: 15px; line-height: 1.2; }

/* --- SHOP CARDS & GRID --- */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card { background: var(--white); border-radius: 8px; transition: 0.3s; overflow: hidden; border: 1px solid transparent; position: relative; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.card:hover { border-color: var(--primary); box-shadow: 0 10px 20px rgba(0,0,0,0.1); transform: translateY(-3px); }
.card-img { height: 200px; width: 100%; object-fit: contain; padding: 15px; }
.card-body { padding: 15px; }
.card-title { font-size: 0.95rem; color: #555; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { font-size: 1.2rem; font-weight: 700; color: var(--dark); }

/* --- FLASH DEALS --- */
.flash-section { background: var(--white); border-radius: 8px; padding: 20px; margin: 30px 0; box-shadow: var(--shadow); }
.flash-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.flash-title { font-size: 1.4rem; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 15px; }
.timer-badge { background: #d32f2f; color: white; padding: 5px 12px; border-radius: 4px; font-size: 0.9rem; font-weight: bold; }

/* --- FOOTER --- */
footer { background: #232f3e; color: #ccc; padding: 60px 0 20px; margin-top: 60px; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: white; margin-bottom: 20px; font-size: 1.1rem; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom { border-top: 1px solid #3a4b5c; padding-top: 20px; text-align: center; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .hero-wrapper { grid-template-columns: 1fr; }
    .cat-sidebar { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { position: absolute; top: 70px; left: 0; width: 100%; background: white; flex-direction: column; padding: 20px; display: none; box-shadow: 0 4px 4px rgba(0,0,0,0.1); }
    .nav-links.active { display: flex; }
    .menu-toggle { display: block; }
    .grid-container { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .slide-content h2 { font-size: 1.8rem; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}