/* Custom Styles for VVVSUPER Mart */

:root {
    --primary-color: #28a745;
    --secondary-color: #20c997;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles - Responsive for all screen sizes */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 76px;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal scroll on all devices */
* {
    max-width: 100%;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Flash News Bar */
.flash-news-bar {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.flash-news-text {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
}

.flash-news-bar marquee {
    height: auto;
}

/* Adjust body padding when flash news is visible */
body.flash-news-visible {
    padding-top: 120px;
}

.flash-news-visible .hero-section {
    margin-top: -120px;
}

/* Navigation Styles */
.navbar {
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    line-height: 1.2;
}

.navbar-brand small {
    display: block;
    font-weight: normal;
    margin-top: 2px;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    margin-top: -76px;
}

.hero-slide {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-slide > .container {
    position: relative;
    z-index: 2;
}

.hero-slide-1 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                      url('https://images.unsplash.com/photo-1542838132-92c53300491e?w=1920');
}

.hero-slide-2 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                      url('https://images.unsplash.com/photo-1610832958506-aa56368176cf?w=1920');
}

.hero-slide-3 {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                      url('https://images.unsplash.com/photo-1556910096-6f5e72db6803?w=1920');
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

/* Category Cards */
.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    user-select: none;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    border-color: var(--primary-color);
}

.category-card i {
    transition: transform 0.3s ease;
}

.category-card:hover i {
    transform: scale(1.2);
}

/* Product Cards */
.product-card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.product-image {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-card .card-img-top {
    overflow: hidden;
}

.badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Deal Cards */
.deal-card {
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.deal-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.deal-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.deal-card:hover {
    transform: translateY(-10px);
}

.deal-card .badge {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Section Spacing */
section {
    scroll-margin-top: 76px;
}

/* Footer */
footer a:hover {
    color: var(--primary-color) !important;
    transition: color 0.3s ease;
}

/* Cart Modal */
#cartItems .cart-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

#cartItems .cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Search Results */
.search-highlight {
    background-color: yellow;
    padding: 2px 4px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Category Card Cursor */
.category-card {
    cursor: pointer;
}

/* Brand Name Responsive */
.brand-name {
    font-size: 1.5rem;
}

.franchise-text {
    font-size: 0.6rem;
}

/* Filter Dropdown */
.filter-dropdown-wrapper {
    width: 100%;
    max-width: 300px;
}

/* Responsive Adjustments */

/* Extra Large Devices (Large Desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .product-card {
        min-height: 380px;
    }
}

/* Large Devices (Desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .brand-name {
        font-size: 1.3rem;
    }
    
    .product-card {
        min-height: 360px;
    }
}

/* Medium Devices (Tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    body.flash-news-visible {
        padding-top: 130px;
    }
    
    .flash-news-bar {
        top: 76px;
    }
    
    .flash-news-visible .hero-section {
        margin-top: -130px;
    }
    .brand-name {
        font-size: 1.1rem;
    }
    
    .franchise-text {
        font-size: 0.55rem;
    }
    
    .hero-slide h1 {
        font-size: 2.5rem;
    }
    
    .hero-slide p {
        font-size: 1.1rem;
    }
    
    .category-card {
        padding: 1.5rem !important;
    }
    
    .category-card h5 {
        font-size: 1rem;
    }
    
    .category-card i {
        font-size: 2.5rem !important;
    }
    
    .product-card {
        min-height: 340px;
    }
    
    .filter-dropdown-wrapper {
        max-width: 250px;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .input-group {
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
}

/* Small Devices (Landscape Phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    body.flash-news-visible {
        padding-top: 120px;
    }
    
    .flash-news-bar {
        top: 76px;
        font-size: 0.85rem;
    }
    
    .flash-news-visible .hero-section {
        margin-top: -120px;
    }
    .brand-name {
        font-size: 1rem;
    }
    
    .franchise-text {
        font-size: 0.5rem;
    }
    
    .hero-slide h1 {
        font-size: 2rem;
    }
    
    .hero-slide p {
        font-size: 1rem;
    }
    
    .category-card {
        padding: 1rem !important;
    }
    
    .category-card h5 {
        font-size: 0.9rem;
    }
    
    .category-card i {
        font-size: 2rem !important;
    }
    
    .product-card {
        min-height: 320px;
    }
    
    .product-image {
        height: 200px !important;
    }
    
    .filter-dropdown-wrapper {
        max-width: 100%;
        margin-top: 1rem;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .input-group {
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    #products h2 {
        margin-bottom: 1rem !important;
    }
}

/* Extra Small Devices (Portrait Phones, less than 576px) */
@media (max-width: 575px) {
    body {
        padding-top: 70px;
    }
    
    body.flash-news-visible {
        padding-top: 110px;
    }
    
    .flash-news-bar {
        top: 70px;
        font-size: 0.8rem;
        padding: 0.5rem 0 !important;
    }
    
    .flash-news-text {
        font-size: 0.8rem;
    }
    
    .flash-news-bar .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .flash-news-visible .hero-section {
        margin-top: -110px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .brand-name {
        font-size: 0.85rem;
        display: block;
    }
    
    .franchise-text {
        font-size: 0.45rem;
        margin-top: 2px;
    }
    
    .hero-section {
        margin-top: -70px;
    }
    
    .hero-slide h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem !important;
    }
    
    .hero-slide p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-slide .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1.5rem;
    }
    
    .category-card {
        padding: 1rem !important;
        margin-bottom: 0.5rem;
    }
    
    .category-card h5 {
        font-size: 0.85rem;
        margin-bottom: 0;
    }
    
    .category-card i {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .product-card {
        min-height: 300px;
        margin-bottom: 1rem;
    }
    
    .product-image {
        height: 180px !important;
    }
    
    .product-card .card-title {
        font-size: 0.95rem;
    }
    
    .product-card .btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .filter-dropdown-wrapper {
        max-width: 100%;
        width: 100%;
        margin-top: 1rem;
    }
    
    #categoryFilter {
        width: 100%;
        min-width: 100% !important;
        font-size: 0.9rem;
    }
    
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .input-group {
        max-width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .input-group input {
        font-size: 0.9rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    #products h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem !important;
    }
    
    .cart-item {
        flex-wrap: wrap;
        padding: 0.75rem 0 !important;
    }
    
    .cart-item-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .cart-item h6 {
        font-size: 0.9rem;
    }
    
    .quantity-controls {
        margin: 0.5rem 0;
    }
    
    footer {
        padding: 2rem 0 !important;
    }
    
    footer h5 {
        font-size: 1.1rem;
    }
    
    footer p {
        font-size: 0.9rem;
    }
    
    .deal-card .card-body {
        padding: 1.5rem !important;
    }
    
    .deal-card h4 {
        font-size: 1.25rem;
    }
    
    section {
        padding: 2rem 0 !important;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Animation for product cards */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* Button Hover Effects */
.btn-success {
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Empty Cart Message */
.empty-cart {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-cart i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

