/* --- Global Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ADD THIS NEW RULE */
main {
    flex-grow: 1;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    /* The overflow: auto; line has been removed */
}

/* --- Header & Navigation --- */
header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
    border-bottom: #007bff 3px solid;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.8rem;
    font-weight: bold;
}

header nav ul {
    list-style: none;
}

header nav ul li {
    display: inline;
    margin-left: 20px;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
}

header nav ul li a:hover {
    color: #007bff;
}

header nav ul li a.active {
    color: #007bff;
    font-weight: bold;
}

/* --- Hero Section (Banner) --- */
.hero {
    background: #007bff;
    color: #fff;
    padding: 4rem 1rem;
    text-align: center;
    margin-bottom: 2rem;
    /* This prevents content from spilling during animation */
    overflow: hidden; 
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    /* Animation Added */
    animation: slideInDown 0.7s ease-out 0.2s backwards;
}

.hero p {
    font-size: 1.2rem;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    /* Animation Added */
    animation: slideInDown 0.7s ease-out 0.4s backwards;
}

/* --- Home Page Content --- */
.main-content {
    padding: 2rem 0;
    text-align: center;
    /* Animation Added */
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.main-content h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.main-content p {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto 2rem auto;
}

.main-content .btn {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

.main-content .btn:hover {
    background-color: #0056b3;
}


/* --- Shop Page (Product Grid) --- */
.products-heading {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
    /* Animation Added */
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    padding: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    
    /* --- Animation Added --- */
    opacity: 100; /* Start hidden for animation */
    animation: fadeInUp 0.6s ease-out backwards;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Stagger the card animations for a nice effect */
.product-card:nth-child(1) { animation-delay: 0.7s; }
.product-card:nth-child(2) { animation-delay: 0.8s; }
.product-card:nth-child(3) { animation-delay: 0.9s; }
.product-card:nth-child(4) { animation-delay: 1.0s; }
/* Add more if you add more products */
.product-card:nth-child(5) { animation-delay: 1.1s; }
.product-card:nth-child(6) { animation-delay: 1.2s; }


.product-card img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.product-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 1rem;
}

.product-card .btn {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.product-card .btn:hover {
    background: #0056b3;
}

/* --- About & Contact Page Content Box --- */
.content-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 2.5rem 3rem;
    max-width: 900px;
    margin: auto;
    /* Animation Added */
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.content-box .page-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: #333;
    font-weight: 600;
}

.content-box h2 {
    font-size: 1.5rem;
    color: #007bff;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.content-box p {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* --- Contact Page Form --- */
.contact-form {
    max-width: 700px; /* Sets the width of the form */
    margin: 0 auto; /* Centers the form */
}

.contact-form p {
    text-align: center;
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block; /* Puts the label on its own line */
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%; /* Makes the input field full-width */
    padding: 12px;
    margin-bottom: 1.5rem; /* Adds space below the field */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit; 
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form input[type="submit"] {
    display: block;
    width: auto;
    margin: 0 auto; /* Centers the submit button */
    background: #007bff;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-form input[type="submit"]:hover {
    background-color: #0056b3;
}


/* --- Footer --- */
footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* --- Search Bar Styling --- */
.search-container {
    text-align: center; /* Centers the input element */
    margin-bottom: 2rem; /* Space before the product grid */
    animation: fadeInUp 0.8s ease-out 0.6s backwards; /* Match other animations */
}

#search-bar {
    width: 100%;
    max-width: 500px; /* Keeps it from being too wide */
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#search-bar:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

/* =================================
--- NEW ANIMATION RULES ADDED --- 
=================================
*/

/* Keyframes define the animation steps */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =================================
   --- PRODUCT DETAIL PAGE STYLES --- 
   =================================
*/

/* This creates the two-column grid */
.product-detail-layout {
    display: grid;
    /* On large screens, two columns. On small, it stacks to 1. */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem; /* Space between image and text */
}

/* --- Left Column (Image) --- */
.product-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* --- Right Column (Details) --- */
.product-details {
    /* No styles needed, just a container */
}

.product-details .product-category {
    font-size: 0.9rem;
    font-weight: bold;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-details .product-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-details .product-price {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff; /* Main blue color */
    margin-bottom: 1.5rem;
}

.product-details .product-description {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.7;
}

/* Using your existing .btn style but making it bigger */
.product-buy-button {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 14px 32px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-top: 1.5rem;
    text-align: center;
}

.product-buy-button:hover {
    background: #0056b3;
}

/* Trust badges like in your example */
.trust-badges {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    color: #444;
}

.trust-badges li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

/* This adds the checkmark */
.trust-badges li::before {
    content: '✔'; /* Checkmark character */
    color: #28a745; /* Green */
    margin-right: 10px;
    font-weight: bold;
}

/* =================================
   --- CHECKOUT PAGE STYLES --- 
   =================================
*/

/* This creates the main 2-column layout */
.checkout-layout {
    display: grid;
    /* On large screens, 2 columns. On small, it stacks to 1. */
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* This targets the left (main) column */
.checkout-main {
    /* No styles needed, just a container */
}

/* This targets the right (sidebar) column */
.checkout-sidebar {
    /* No styles needed, just a container */
}

/* We'll use this white box for all sections */
.checkout-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1.5rem 2rem; /* A bit less padding than content-box */
    margin-bottom: 1.5rem;
}

.checkout-box h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

/* Style for the product shown in the cart */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #eee;
}

.cart-item-details h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.cart-item-details p {
    font-size: 1rem;
    color: #007bff;
    font-weight: bold;
    margin: 0.25rem 0 0 0;
}

/* Order Summary (Right Column) */
.order-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #555;
    margin-bottom: 1rem;
}

.order-summary-row span {
    font-weight: 500;
}

.order-summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.order-summary-row.total span {
    font-weight: bold;
    color: #007bff;
}

/* We'll re-use your main .btn style for the checkout button */
.checkout-button {
    display: block;
    width: 100%;
    background: #007bff;
    color: #fff;
    padding: 14px 28px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.checkout-button:hover {
    background: #0056b3;
}

/* This makes the layout stack on small screens */
@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr; /* Stacks to 1 column */
    }
    .checkout-sidebar {
        /* This moves the summary to the top on mobile, which is common */
        order: -1; 
    }
}

/* ===================================================
   --- FULL CHECKOUT & PAYMENT PAGE STYLES --- 
   ===================================================
*/

/* --- 1. NEW Animation Definition --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 2. Animate the Page Title --- */
/* This targets the <h1> on checkout.html and payment.html */
main .page-title {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}


/* --- 3. Layout and Content Boxes --- */
.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 2-column layout */
    gap: 2rem;
}

/* Animate the left column */
.checkout-main {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

/* Animate the right column (sidebar) */
.checkout-sidebar {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.checkout-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.checkout-box h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}


/* --- 4. Shipping Form Styles (Left Column) --- */
#shipping-form label {
    display: block; /* Label on its own line */
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

#shipping-form input[type="text"],
#shipping-form textarea {
    width: 100%; /* Full width */
    padding: 12px;
    margin-bottom: 1.5rem; /* Space below */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit; 
}

#shipping-form textarea {
    resize: vertical;
    min-height: 120px;
}


/* --- 5. Cart & Quantity Styles (Left Column) --- */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #eee;
}

.cart-item-details h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.cart-item-details p {
    font-size: 1rem;
    color: #007bff;
    font-weight: bold;
    margin: 0.25rem 0 0 0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.quantity-selector label {
    font-weight: bold;
    color: #333;
}

.quantity-selector .qty-btn {
    width: 30px;
    height: 30px;
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    line-height: 28px;
}

.quantity-selector .qty-btn:hover {
    background-color: #eee;
}

.quantity-selector .qty-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    -moz-appearance: textfield;
}

.quantity-selector .qty-input::-webkit-outer-spin-button,
.quantity-selector .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


/* --- 6. Order Summary (Right Column) --- */
.order-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: #555;
    margin-bottom: 1rem;
}

.order-summary-row span {
    font-weight: 500;
}

.order-summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.order-summary-row.total span {
    font-weight: bold;
    color: #007bff;
}

.checkout-button {
    display: block;
    width: 100%;
    background: #007bff;
    color: #fff;
    padding: 14px 28px;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
}

.checkout-button:hover {
    background: #0056b3;
}


/* --- 7. Payment Page Styles --- */
.payment-options {
    margin-top: 1rem;
}
.payment-options label {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
}
.payment-options input[type="radio"] {
    margin-right: 10px;
}
.payment-options label:hover {
    background: #f0f0f0;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
    color: #777;
}
.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ccc;
}
.separator:not(:empty)::before {
    margin-right: .25em;
}
.separator:not(:empty)::after {
    margin-left: .25em;
}


/* --- 8. Responsive Stacking --- */
@media (max-width: 768px) {
    .checkout-layout {
        grid-template-columns: 1fr; /* Stacks to 1 column */
    }
    .checkout-sidebar {
        order: -1; /* Moves summary to the top on mobile */
    }
}

/* =================================
   --- BACK BUTTON STYLES --- 
   =================================
*/

.back-button {
    display: inline-block;
    padding: 8px 15px;
    margin-bottom: 1rem; /* Space before the title */
    background-color: #f4f4f4;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: #e9e9e9;
}

/* =================================
   --- CONTACT FORM FIX --- 
   (Applies the same style as the checkout form)
   =================================
*/

.contact-form label {
    display: block; /* Puts the label on its own line */
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%; /* Makes the input field full-width */
    padding: 12px;
    margin-bottom: 1.5rem; /* Adds space below the field */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit; 
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px; /* Makes the address box taller */
}

.contact-form input[type="submit"] {
    display: block;
    margin: 0 auto; /* Centers the submit button */
}

/* =================================
   --- MOBILE RESPONSIVE STYLES --- 
   (Fixes layout on phones)
   =================================
*/
@media (max-width: 768px) {
    
    /* 1. Stack the Header: Logo on top, Menu below */
    header .container {
        flex-direction: column; /* Stack vertical */
        text-align: center;
    }

    /* 2. Fix the Logo Alignment */
    header .logo {
        margin-bottom: 1rem; /* Add space below logo */
        display: flex;
        justify-content: center; /* Center the logo image and text */
        width: 100%;
    }
    
    /* Ensure the logo link centers its content */
    header .logo a {
        justify-content: center;
    }

    /* 3. Fix the Navigation Menu */
    header nav ul {
        display: flex;
        flex-wrap: wrap; /* Allow links to wrap to next line if needed */
        justify-content: center; /* Center the links */
        padding: 0;
        margin-top: 5px;
    }

    header nav ul li {
        margin: 5px 10px; /* Add breathing room around links */
        display: inline-block;
    }

    /* 4. Resize the Big Banner Text (Hero) */
    .hero {
        padding: 3rem 1rem; /* Less padding on mobile */
    }

    .hero h1 {
        font-size: 2rem; /* Smaller font size */
    }

    .hero p {
        font-size: 1rem;
    }
    
    /* 5. Fix Checkout Layout for Mobile */
    .checkout-layout {
        grid-template-columns: 1fr; /* Stack checkout columns */
    }
    
    .checkout-sidebar {
        order: -1; /* Put Order Summary at the top on mobile */
        margin-bottom: 2rem;
    }
}

/* =================================
   --- HEADER BUTTON STYLES --- 
   =================================
*/

/* 1. "Sign In" Button (Transparent with White Border) */
header nav ul li a.btn-signin {
    border: 2px solid #fff;    /* The white rectangle border */
    background-color: transparent;
    padding: 8px 20px;         /* Size of the rectangle */
    border-radius: 5px;        /* Rounded corners */
    margin-right: -5px;        /* Space between the two buttons */
    font-weight: bold;
    transition: all 0.3s ease;
}

header nav ul li a.btn-signin:hover {
    background-color: #fff;    /* Fills with white when hovered */
    color: #333 !important;    /* Text turns dark */
}

/* 2. "Create Account" Button (Solid Blue) */
header nav ul li a.btn-signup {
    background-color: #007bff; /* Blue background */
    border: 2px solid #007bff; /* Blue border */
    color: #fff;
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
}

header nav ul li a.btn-signup:hover {
    background-color: #0056b3; /* Darker blue on hover */
    border-color: #0056b3;
}
