:root {
    --primary: #5cb85c; /* Green for nature/pets */
    --secondary: #f0ad4e; /* Orange for warmth/playfulness */
    --accent: #5bc0de; /* Blue for calm/trust */
    --bg: #f8f8f8;
    --surface: #ffffff;
    --text: #333333;
    --muted: #6c757d;
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.8em;
}

h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.75vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 4rem 0;
}

.bg-surface {
    background-color: var(--surface);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8em 1.5em;
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--surface);
}
.btn-primary:hover {
    background-color: #4cae4c;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--surface);
}
.btn-secondary:hover {
    background-color: #eea236;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background-color: #dc3545;
    color: var(--surface);
}
.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.icon-button:hover {
    background-color: rgba(0,0,0,0.05);
    color: var(--primary);
}
.icon-button svg {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.error-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 0.5rem;
}

/* Header */
.main-header {
    background-color: var(--surface);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.main-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav .nav-list a {
    color: var(--text);
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
}

.main-nav .nav-list a.active::after,
.main-nav .nav-list a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.main-nav .nav-list a.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.main-nav .nav-list a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-count {
    background-color: var(--secondary);
    color: var(--surface);
    border-radius: 50%;
    padding: 0.2em 0.5em;
    font-size: 0.75rem;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    text-align: center;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
}

/* Hero Section */
.hero {
    background: url('https://picsum.photos/seed/pet-shop-hero/1920/1080') no-repeat center center/cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--surface);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero-content h1 {
    color: var(--surface);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-card p {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-card .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.product-card .add-to-cart-btn {
    width: 100%;
}

/* About Section */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .grid-2-cols {
        grid-template-columns: 1fr 1fr;
    }
}

.about-image img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Contact Section */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Footer */
.main-footer {
    background-color: var(--text);
    color: var(--muted);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.social-links a {
    color: var(--muted);
    margin: 0 0.5rem;
}

.social-links a:hover {
    color: var(--primary);
}

/* Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--surface);
    margin: auto;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    position: relative;
    max-width: 90%;
    width: 600px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-button {
    color: var(--muted);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}

/* Cart Modal Specific */
#cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.cart-item-details p {
    font-size: 0.9rem;
    color: var(--muted);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-quantity input {
    width: 50px;
    text-align: center;
    padding: 0.4em;
    border-radius: var(--radius);
    border: 1px solid #ddd;
}

.cart-item-quantity button {
    background-color: var(--accent);
    color: var(--surface);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cart-item-quantity button:hover {
    background-color: #46b8da;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.remove-item-btn:hover {
    color: #c82333;
}

.cart-summary {
    text-align: right;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.checkout-form {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* Admin Panel Specific */
#auth-section {
    background-color: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

#auth-section .form-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#auth-section input {
    width: 100%;
    max-width: 300px;
}

#auth-section button {
    width: 100%;
    max-width: 300px;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
}

.tab-button {
    background-color: transparent;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-button.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: var(--primary);
    color: var(--surface);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.admin-table tbody tr:hover {
    background-color: #f5f5f5;
}

.admin-table .actions button {
    margin-right: 0.5rem;
    padding: 0.5em 1em;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    padding: 0.3em 0.8em;
    border-radius: var(--radius);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending {
    background-color: #ffc107;
    color: #343a40;
}

.status-badge.paid,
.status-badge.fulfilled {
    background-color: var(--primary);
    color: var(--surface);
}

.status-badge.cancelled {
    background-color: #dc3545;
    color: var(--surface);
}

/* Payment Success Page */
.payment-status-section {
    text-align: center;
    background-color: var(--surface);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 2rem auto;
}

.payment-status-section .status-icon {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.payment-status-section h1 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.order-summary-details {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg);
    border: 1px solid #eee;
    text-align: left;
}

.order-summary-details h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.order-summary-details ul {
    list-style: inside;
    margin-top: 0.5rem;
    padding-left: 1rem;
}

.order-summary-details li {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--surface);
        box-shadow: var(--shadow);
        padding: 1rem 0;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .main-nav .nav-list a {
        padding: 0.8rem 1.5rem;
        width: 100%;
        text-align: center;
    }

    .menu-toggle {
        display: block;
    }

    .header-content {
        padding: 0 1rem;
    }

    .hero {
        min-height: 70vh;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .footer-content {
        flex-direction: column;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .cart-item {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .cart-item-details {
        flex-basis: 100%;
        margin-bottom: 0.5rem;
    }

    .cart-item-quantity {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.6em 1.2em;
        font-size: 0.9rem;
    }

    .admin-table th, .admin-table td {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .status-badge {
        font-size: 0.75em;
    }
}