/* ==========================================================================
   1. CSS RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #3498db;
    --dark-color: #ff1b7a;
    --light-color: #f4f4f4;
    --text-color: #333;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Global Layout Containers --- */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
header {
    background: var(--dark-color);
    color: #fff;
    padding: 1rem 0;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header ul {
    display: flex;
}

header ul li {
    margin-left: 20px;
}


.discountBanner {
    color: #ffffff;
    background-color: #00b7ff;

    text-align: center;
    outline: #333;
    size: 10px;
}

.discountText {

    color: #ffffff;

}

/* Centers the cart image vertically with the text links */
.cart-link {
    display: flex;
    align-items: center;
    height: 100%; 
    position: relative; /* Crucial for positioning the badge */
}

/* New CSS for the badge */
.cart-badge {
    position: absolute;
    bottom: -5px; 
    right: -10px;  
    background-color: #fff; /* White background to pop against your pink header */
    color: var(--dark-color); /* Pink text */
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    display: none; /* Hidden by default until JS checks the cart */
}

/* Styles the icon and preps it for a smooth hover effect */
.bannerCart {
    width: 25px;
    height: auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Makes the cart icon grow slightly and fade a tiny bit when hovered */
.cart-link:hover .bannerCart {
    transform: scale(1.15);
    opacity: 0.85;
}


/* ==========================================================================
   3. HERO SECTION & BUTTONS
   ========================================================================== */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}

.btn:hover {
    opacity: 0.9;
}

/* --- Add to Cart Success State --- */
.btn-success {
    background-color: #27ae60 !important; /* Success Green */
    color: #fff !important;
    pointer-events: none; /* Prevents clicking again while the message shows */
    transition: background-color 0.5s ease;
}

/* ==========================================================================
   4. CATEGORY SECTION (Square Cards)
   ========================================================================== */
.category-container {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
    justify-content: center;
}

.category-card {
    position: relative;
    flex: 1;
    aspect-ratio: 1 / 1; 
    border-radius: 20px;
    overflow: hidden; 
    display: block;
}

.category-card img {
    width: 100%; /* Fixed from 10% */
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.5s ease;
}

.category-overlay span {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* --- Category Hovers --- */
.category-card:hover img {
    transform: scale(1.1);
    filter: grayscale(20%) brightness(80%);
}

.category-card:hover .category-overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   5. PRODUCT GRID
   ========================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 60px;
}

.product-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 27, 122, 0.2); 
}

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
    text-align: center;
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-info .price {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--light-color);
    margin-top: 2rem;
}

/* ==========================================================================
   7. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .category-container {
        flex-direction: column;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}



/* ==========================================================================
   8. REVIEWS & CONTACT STYLES
   ========================================================================== */

/* --- Reviews --- */
.reviews-section {
    padding: 4rem 2rem;
    text-align: center;
    background-color: #fffafc; /* Light pink tint to separate sections */
    border-radius: 30px;
    margin-top: 2rem;
}

.reviews-header h2 {
    font-size: 2.5rem;
    color: var(--dark-color);
}

.stars {
    color: #f1c40f; /* Gold stars */
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.customer-count {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.review-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    font-style: italic;
}

.review-card span {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
    font-style: normal;
    color: var(--dark-color);
}

/* --- Contact/Review Form --- */
.contact-section {
    padding: 5rem 2rem;
    text-align: center;
}

.contact-box {
    max-width: 700px;
    margin: 0 auto;
}

#user-message {
    width: 100%;
    height: 150px;
    padding: 1rem;
    margin: 1.5rem 0;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

#user-message:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Secondary Button Style */
.btn-secondary {
    background: #333 !important; /* Dark grey/black for contrast */
}

/* Mobile Tweak for buttons */
@media (max-width: 600px) {
    .contact-buttons {
        flex-direction: column;
    }
}


/* Back Button Styling */
.back-link {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    margin-bottom: -5px; /* Pulls it closer to the image */
    width: fit-content;
}

.back-link:hover {
    color: var(--dark-color);
}


#carousel-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}

#carousel-thumbnails img:hover {
    border-color: var(--dark-color);
}

/* Quantity Box Styling */
.qty-btn {
    width: 45px;
    height: 45px;
    background-color: #eee;
    border: 1px solid #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qty-btn:hover {
    background-color: #ddd;
}

.qty-input {
    width: 60px;
    height: 45px;
    text-align: center;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    border-left: none;
    border-right: none;
    font-size: 1.1rem;
}

/* Hides arrows in Chrome, Safari, Edge */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ==========================================================================
   9. TOOLTIP STYLES
   ========================================================================== */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    cursor: help; /* Changes cursor to a question mark on desktop */
}

.tooltip-icon {
    background-color: black;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    font-style: italic; /* Gives the 'i' the classic tooltip look */
    font-family: serif;
    transition: transform 0.2s ease;
}

/* Enlarge slightly on hover */
.tooltip-container:hover .tooltip-icon,
.tooltip-container:focus-within .tooltip-icon {
    transform: scale(1.15);
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 100;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease, bottom 0.2s ease;
    font-size: 0.85rem;
    font-weight: normal;
    pointer-events: none; /* Prevents the tooltip window from blocking clicks */
    box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
    line-height: 1.4;
}

/* The little triangle pointing down from the tooltip window */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Show the tooltip text on hover */
.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text {
    visibility: visible;
    opacity: 1;
    bottom: 140%; /* Creates a slight sliding up animation */
}



/* ==========================================================================
   ADMIN ORDERS DASHBOARD
   ========================================================================== */
.admin-orders-page {
    margin-bottom: 60px;
}

.orders-toolbar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.order-search-bar {
    width: 100%;
    max-width: 600px;
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 30px;
    outline: none;
    transition: border-color 0.3s ease;
}

.order-search-bar:focus {
    border-color: var(--dark-color);
}

.order-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tab-btn {
    padding: 8px 16px;
    border: 2px solid var(--dark-color);
    background: transparent;
    color: var(--dark-color);
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 27, 122, 0.1);
}

.tab-btn.active {
    background: var(--dark-color);
    color: white;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.order-card-admin {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.order-card-admin:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 27, 122, 0.2);
}

/* Image Splitting Logic */
.order-images-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    gap: 2px;
    background: #eee;
}

.order-images-container.items-1 { grid-template-columns: 1fr; }
.order-images-container.items-2 { grid-template-columns: 1fr 1fr; }
.order-images-container.items-3 { grid-template-columns: 1fr 1fr 1fr; }
.order-images-container.items-4-plus { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.img-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qty-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--dark-color);
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.order-details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.order-header h3 {
    font-size: 1.1rem;
    color: var(--text-color);
}

.order-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    background: #eee;
}

.status-awaiting { background: #f39c12; color: white; }
.status-shipped { background: #27ae60; color: white; }
.status-cancelled { background: #e74c3c; color: white; }
.status-refunded { background: #7f8c8d; color: white; }

.order-customer {
    font-weight: bold;
    color: var(--primary-color);
}

.order-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #555;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#page-info {
    font-weight: bold;
    font-size: 1.1rem;
}


/* ==========================================================================
   ADMIN SINGLE ORDER DETAILS
   ========================================================================== */
.admin-single-order {
    margin-top: 40px;
    margin-bottom: 60px;
}

.order-header-actions {
    margin-bottom: 30px;
}

.order-header-actions h1 {
    color: var(--dark-color);
    margin-top: 10px;
}

.order-details-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}

.order-sidebar {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-main-content {
    flex: 2;
    min-width: 350px;
}

.admin-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.admin-card h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f4f4f4;
    color: var(--text-color);
}

.highlight-card {
    border-top: 4px solid var(--dark-color);
}

.address-block {
    line-height: 1.8;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #444;
}

.order-date, .order-stripe {
    color: #666;
    margin-bottom: 5px;
}

/* --- Form Controls --- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.status-dropdown {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.status-dropdown:focus {
    border-color: var(--dark-color);
}

/* --- Items List --- */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.order-item-row {
    display: flex;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.order-item-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background: #f4f4f4;
}

.order-item-info {
    flex: 1;
}

.order-item-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.order-item-options {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    background: #f9f9f9;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
}

.order-item-price-qty {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    color: #333;
}

/* --- Totals --- */
.order-totals {
    border-top: 2px solid #eee;
    padding-top: 15px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.grand-total {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--dark-color);
    margin-top: 10px;
}