/* --- Amazon Inspired Color Palette --- */
:root {
    --amazon-dark-primary: #131921;
    --amazon-dark-secondary: #232F3E;
    --amazon-accent: #FF9900; 
    --amazon-success: #007600; 
    --text-dark: #111;
    --text-light: #fff;
    --background-light: #EAEDED; 
    --border-color: #ddd;
    --product-price-color: #B12704; 
    --link-color: #007185; 
}

/* --- 1. Global Styles and Reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-top: 60px;
}

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

/* --- 2. Header and Navigation (AMAZON LOOK) --- */
header {
    background-color: var(--amazon-dark-primary);
    color: var(--text-light);
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--amazon-accent);
    text-decoration: none;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 30px; 
    width: auto;
    vertical-align: middle; 
    margin-right: 8px; 
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 20px;
    padding: 5px 0;
    transition: color 0.2s;
    font-size: 0.9em;
}

nav a:hover {
    color: var(--amazon-accent);
    text-decoration: underline;
}

.admin-link {
    background-color: var(--amazon-dark-secondary); 
    padding: 5px 10px;
    border-radius: 3px;
}

/* --- 3. Homepage Slider --- */
.slider-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 30px auto;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.slider-track {
    display: flex;
    transition: transform 0.8s ease-in-out; 
}

.slide {
    width: 33.33%; 
    flex-shrink: 0;
    position: relative;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 15px;
    font-size: 1.6em;
    font-weight: bold;
    text-align: center;
}

/* --- 4. Product Grid & Cards (products.php) --- */
h1 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 400; 
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); 
    text-align: center;
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); 
}

.product-card a {
    text-decoration: none;
    color: var(--text-dark);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: contain; 
    border-radius: 4px;
    margin-bottom: 10px;
}

.product-card h2 {
    font-size: 1.1em;
    height: 40px; 
    overflow: hidden;
    margin-bottom: 5px;
    line-height: 1.2;
}

.product-price {
    color: var(--product-price-color); 
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

/* --- 5. Forms and Buttons --- */
.filter-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    padding: 10px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* ... (Other form styles remain the same) ... */

.add-to-cart-btn {
    background-color: var(--amazon-accent); 
    border: 1px solid #c88900;
    color: var(--text-dark);
    padding: 8px 15px;
    border-radius: 8px; 
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.1s;
    width: 100%;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.add-to-cart-btn:hover {
    background-color: #f7a83d;
}

.view-details-link {
    display: block;
    margin-top: 10px;
    color: var(--link-color); 
    font-size: 0.9em;
    text-decoration: none;
}

/* --- 6. Category Card Styles (index.php) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px;
    margin-top: 30px;
}

.category-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); 
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}
/* ... (Other category card styles remain the same) ... */

/* --- 7. FEATURED DEAL CARDS (index.php) --- */
.featured-deals-section {
    margin-top: 30px;
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
}
.deal-card {
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}
.deal-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.deal-card img {
    width: 100%;
    height: 180px; 
    object-fit: cover;
}
.deal-content {
    padding: 15px;
}
.deal-content h3 {
    font-weight: bold;
}
.deal-link {
    color: var(--link-color);
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

/* --- 8. DYNAMIC PRODUCT CAROUSEL (index.php) --- */
.product-carousel {
    margin-bottom: 30px;
    padding: 20px 0; /* Left/right padding removed for full-width scroll effect */
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden; /* Scrollbar ko container ke andar rakhta hai */
}
.product-carousel h2 {
    font-weight: 400;
    margin-bottom: 15px;
    color: var(--amazon-dark-primary);
    padding-left: 20px; /* Title padding */
}
.carousel-track {
    display: flex;
    overflow-x: scroll; /* Enable horizontal scrolling */
    scroll-snap-type: x mandatory; 
    gap: 15px;
    padding: 10px 20px 20px 20px; /* Top, Right, Bottom (for scrollbar), Left padding */
}
/* Scrollbar Styling (Optional) */
.carousel-track::-webkit-scrollbar {
    height: 8px;
}
.carousel-track::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.carousel-item {
    flex: 0 0 auto;
    width: 180px; /* Slightly smaller width for more items in view */
    text-align: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
    scroll-snap-align: start;
    transition: box-shadow 0.2s;
}
.carousel-item:hover {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}
.carousel-item .product-image {
    height: 100px;
    object-fit: contain;
    margin-bottom: 8px;
}
.carousel-item h3 {
    font-size: 0.9em;
    height: 35px;
    overflow: hidden;
    margin-bottom: 5px;
    line-height: 1.2;
    font-weight: normal;
}
.carousel-item .product-price {
    font-size: 1em;
    color: var(--product-price-color);
    font-weight: bold;
    margin-bottom: 8px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .featured-deals-section {
        grid-template-columns: 1fr; 
    }
    .deal-card img {
        height: 250px;
    }
}