/* style.css - Modern Responsive Styles for HushCart */


/* Base Styles & Variables */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Base Reset & Typography */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    /* FIX: Changed 'max-width: 8rem' to 'max-width: 100%'
       Your old rule made all images tiny. This is a safer default. */
    max-width: 100%;
    height: auto;
    display: block;
}
.footer-about a img{
    max-width: 8rem;
    height: auto;
    display: block;
}


/* Utility Classes */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.text-primary {
    color: var(--primary);
}

.bg-light {
    background-color: var(--light-gray);
}


/* Animations */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide {
    animation: slideUp 0.5s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}


/* Navbar Styles */

.navbar {
    background-color: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.navbar-brand img {
    height: 40px;
    transition: var(--transition);
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* FIX: New Navbar Toggler Styles 
  This creates a clean animated hamburger icon.
  It works with the 'active' class toggled by your existing navbar.php script.
*/
.navbar-toggler {
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    background-color: transparent;
    transition: var(--transition);
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--dark);
    border-radius: 1px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease-out;
}

.navbar-toggler-icon-line:nth-child(1) {
    top: 6px;
}

.navbar-toggler-icon-line:nth-child(2) {
    top: 14px;
}

.navbar-toggler-icon-line:nth-child(3) {
    top: 22px;
}

/* 'active' class (toggled) state, matching navbar.php JS */
.navbar-toggler.active .navbar-toggler-icon-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    top: 6px;
}

.navbar-toggler.active .navbar-toggler-icon-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggler.active .navbar-toggler-icon-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    top: 22px;
}
/* End Navbar Toggler Fix */


/* Hero Carousel */

.hero-carousel {
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.carousel-item {
    height: 70vh;
    min-height: 500px;
}

.hero-section {
    height: 100%;
    background-size: cover !important;
    background-position: center !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
    border-radius: var(--radius-md);
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    margin: 0 5px;
    border: none;
    opacity: 0.7;
    transition: var(--transition);
}

.carousel-indicators button.active {
    opacity: 1;
    transform: scale(1.2);
}


/* Product Cards */

.product-card {
    transition: var(--transition);
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out forwards;
    /* FIX: Removed 'opacity: 0' and 'animation-delay'
       This ensures cards are visible by default and fade in together.
       The old 'animation-delay' required a PHP variable that wasn't set. */
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.product-img-container {
    position: relative;
    overflow: hidden;
    height: 200px;
    /* FIX: Added background color for a clean look with 'contain' */
    background-color: #ffffff; 
}

.product-img {
    width: 100%;
    height: 100%;
    /* FIX: Changed 'cover' to 'contain'
       This ensures the *entire* product is visible, which is
       better for e-commerce. It won't crop parts of the product. */
    object-fit: contain;
    transition: var(--transition-slow);
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.card-body {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--gray);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.price-original {
    text-decoration: line-through;
    color: var(--gray);
    font-size: 0.9rem;
}

.price-discounted {
    color: var(--danger);
    font-weight: bold;
}


/* Category Cards */

.category-card {
    transition: var(--transition);
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-img {
    height: 150px;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover .category-img {
    transform: scale(1.05);
}


/* Cart & Checkout */

.cart-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.summary-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.quantity-input {
    width: 70px;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--light-gray);
}


/* Forms */

.form-control {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
}

.form-floating label {
    padding: 1rem 1.25rem;
}


/* Testimonials */

.testimonial-card {
    border-left: 4px solid var(--primary);
    transition: var(--transition);
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--radius-md);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}


/* Footer */

.footer {
    background-color: var(--dark);
    color: white;
    padding: 3rem 0 1.5rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
}

.footer a:hover {
    color: white;
}

/* FIX: Added rule for footer logo width */
.footer .footer-about img {
    width: 8rem; /* As requested */
    height: auto; /* Maintains aspect ratio */
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.payment-methods i {
    opacity: 0.7;
    transition: var(--transition);
    font-size: 1.25rem;
}

.payment-methods i:hover {
    opacity: 1;
    color: var(--primary);
}


/* Responsive Adjustments */

@media (max-width: 992px) {
    .carousel-item {
        height: 50vh;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .carousel-item {
        height: 400px;
    }
    .product-card {
        margin-bottom: 1.5rem;
    }
    .footer .col-lg-4 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .carousel-item {
        height: 300px;
    }
    .hero-content {
        padding: 1rem;
    }
    .hero-content h1 {
        font-size: 1.75rem;
    }
    .btn {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}


/* Special Effects */

.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hover-scale {
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.03);
}


/* Loading Animation */

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Floating Elements */

.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* Gradient Text */

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* Custom Scrollbar */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}