/* ==========================================================================
   1. Design System & Global Styles
   ========================================================================== */

/* --- CSS Variables for consistent theming --- */
:root {
    --color-primary: #28a745;
    --color-primary-dark: #218838;
    --color-accent: #f39c12;
    --color-dark: #212529;
    --color-body-text: #343a40;
    --color-muted: #6c757d;
    --color-light: #f8f9fa;
    --color-white: #ffffff;
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --spacing-unit: 1rem;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition-fast: 0.2s ease-in-out;
}

/* --- Global Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* --- Base HTML Styles --- */
html {
    font-size: 100%;
    scroll-behavior: smooth;
}

/* --- Base Body Styles --- */
body {
    font-family: var(--font-primary);
    margin: 0;
    background-color: var(--color-light);
    color: var(--color-body-text);
    line-height: 1.6;
}

/* --- Centered Container Utility --- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Default Element Styles --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

h1, h2, h3, h4 {
    color: var(--color-dark);
    font-weight: 600;
}

/* ==========================================================================
   2. Header & Navigation Styles
   ========================================================================== */

/* --- Main Header Container --- */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- Top Information Bar --- */
.top-bar {
    position: relative; /* Set as positioning context for dropdown */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 40px;
}

.top-bar > p {
    flex-grow: 1;
    text-align: center;
    margin: 0;
    padding-right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Search Box in Header --- */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 350px;
    flex-shrink: 0;
    background-color: #ffffff;
    border: 1px solid #d1d1d1;
    border-radius: 8px;
    overflow: hidden;
}

.search-box::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--color-primary);
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
}

.search-box:focus-within::after {
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: none;
    outline: none;
    background-color: transparent;
    font-size: 16px;
    color: #333;
}

.search-box input::placeholder {
    color: #888888;
}

.search-box button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 45px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888888;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box button:hover i {
    background: linear-gradient(90deg, #28a745, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* --- Header Icons (Cart, Login) --- */
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon-container a i {
    font-size: 22px;
    position: relative;
    background: linear-gradient(90deg, #28a745, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}


/* --- General Dropdown Styles --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown .dropbtn {
    background-color: transparent;
    color: #343a40;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown .dropbtn::after {
    content: '\25BE';
    font-size: 1em; /* Increased arrow size */
    margin-left: 5px;
    -webkit-text-fill-color: var(--color-dark);
}

.top-bar .dropdown {
    position: static; /* Keep static so it doesn't become a positioning context */
}

.top-bar .dropdown .dropbtn {
    background: linear-gradient(90deg, #28a745, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.top-bar .dropdown::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #fd7e14);
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
}

.top-bar .dropdown:focus-within::after {
    width: 100%;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    right: 20px; /* Align to the right padding of top-bar */
    top: 100%; /* Align to bottom of top-bar */
    border-radius: 5px;
}

.dropdown-content a {
    color: black;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown-content a:hover { 
    background: linear-gradient(90deg, #28a745, #fd7e14);
    color: var(--color-white);
}
.dropdown:focus-within .dropdown-content { display: block; }

/* --- Main Navigation Bar --- */
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #fff;
    flex-wrap: wrap;
}

/* --- Site Logo --- */
.logo-img {
    height: 40px;
}

/* --- Navigation Links List --- */
nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

nav ul li a {
    position: relative;
    text-decoration: none;
    color: #343a40;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 5px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: #28a745;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
}

nav ul li a:hover, nav ul li a.active-link {
    color: #28a745;
}
nav ul li a:hover::after, nav ul li a.active-link::after {
    width: 100%;
    background: linear-gradient(90deg, #28a745, #fd7e14);
}

nav ul li a.active-link {
    font-weight: 700;
}

/* --- "More" Dropdown in Navigation --- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a i {
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    list-style: none;
    padding: 10px 0;
    margin-top: 15px; /* Increased margin to move dropdown down */
    min-width: 200px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    border-radius: var(--border-radius);
    border-top: 3px solid var(--color-primary);
}

.nav-dropdown:focus-within .dropdown-menu {
    display: block;
}

.nav-dropdown:focus-within > a i {
    transform: rotate(180deg);
}

.nav-dropdown .dropdown-menu li {
    width: 100%;
}

.nav-dropdown .dropdown-menu li a {
    padding: 10px 20px;
    font-weight: 400;
}

.nav-dropdown .dropdown-menu li a::after {
    display: none;
}

.nav-dropdown .dropdown-menu li a:hover {
    background: linear-gradient(90deg, #28a745, #fd7e14);
    color: var(--color-white);
}


/* ==========================================================================
   4. Footer Styles
   ========================================================================== */

/* --- Main Footer Container --- */
.site-footer {
    background-color: var(--color-dark);
    color: var(--color-light);
    font-size: 0.9rem;
}

/* --- Footer Grid Layout --- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 2.5);
    padding: calc(var(--spacing-unit) * 3) 20px;
}

.footer-logo-img {
    height: 40px;
    margin-bottom: 1rem;
}

/* --- Individual Footer Columns --- */
.footer-column h4 {
    color: var(--color-white);
    margin-top: 0;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.footer-column.about-column h4 {
    margin-top: 1rem;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 50px;
    background-color: var(--color-primary);
}

.footer-column p, .footer-links li, .contact-list li {
    margin-bottom: 0.75rem;
}

.footer-links, .contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links a {
    color: var(--color-light);
    transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.footer-links a:hover {
    background: linear-gradient(90deg, #28a745, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    padding-left: 0;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
}
.contact-list i {
    margin-right: 1rem;
    margin-top: 5px;
    width: 20px;
    background: linear-gradient(90deg, #28a745, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* --- Social Media Icons in Footer --- */
.footer-column .social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer-column .social-icons a {
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.footer-column .social-icons a i {
    background: linear-gradient(90deg, #28a745, #fd7e14);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.footer-column .social-icons a:hover {
    transform: translateY(-3px);
}

/* --- Newsletter Subscription Form --- */
.newsletter-form {
    margin-top: 1.5rem;
}

.newsletter-form h4 {
      margin-bottom: 1rem;
}

.newsletter-form .form-group {
    display: flex;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    background-color: rgba(255,255,255,0.1);
    color: var(--color-white);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    outline: none;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.newsletter-form input:focus {
    background-color: rgba(255,255,255,0.2);
    border-color: var(--color-primary);
}

.newsletter-form button {
    padding: 0.75rem 1.25rem;
    border: none;
    background: linear-gradient(90deg, #28a745, #fd7e14);
    color: var(--color-white);
    cursor: pointer;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: transform var(--transition-fast);
    font-weight: 600;
}

.newsletter-form button:hover {
    transform: scale(1.05);
}

/* --- Copyright Notice --- */
.footer-bottom {
    text-align: center;
    padding: 1.5rem 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.875rem;
}

/* --- Animated Scrolling Notification Bar --- */
.scrolling-bar {
    background: linear-gradient(90deg, #28a745, #fd7e14);
    color: var(--color-white);
    font-weight: 500;
    padding: 0.8rem 0;
    overflow: hidden;
    white-space: nowrap;
}

.scrolling-bar p {
    display: inline-block;
    padding-left: 100%;
    margin: 0;
    animation: scroll-left-animation 30s linear infinite;
}

/* --- Animation for Scrolling Bar --- */
@keyframes scroll-left-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
