:root {
    /* Brand Colors */
    --primary-color: #fb0107;
    --secondary-color: #ff8800;
    --background-color: white;
    
    /* Text Colors */
    --price-color: black;
    --text-color: #222;
    --text-color-medium: #555;
    --text-color-light: #999;
    
    /* Borders & Lines */
    --border-color-light: #ebe5e5;
    --border-color: #ccc;
    --background-color-grey: #e9e9e9;
    
    /* Semantic Colors - Status */
    --color-success: #28a745;
    --color-success-light: #dcfce7;
    --color-success-dark: #065f46;
    --color-success-border: #6ee7b7;
    --color-danger: rgb(219, 36, 54);
    --color-danger-light: #fee2e2;
    --color-danger-dark: #991b1b;
    --color-danger-border: #fca5a5;
    --color-info: #17a2b8;
    --color-info-light: #e7f3ff;
    --color-warning: #ffa500;
    --color-warning-light: #fff4e5;
    --color-warning-dark: #cc8400;
    
    /* Typography & Spacing */
    --border-radius: 8px;
    --box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: var(--font-family);
    background: var(--background-color);
    color: var(--text-color);
}

main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1;
    box-sizing: border-box;
}

.hero-image {
    width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    object-fit: cover;
}

/* ── Buttons ─────────────────────────────── */
button,
.button {
    all: unset;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, opacity 0.2s;
    display: inline-block;
}

.btn-wide {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.btn-outline {
    background-color: var(--background-color);
    color: var(--primary-color);
    padding: 9px 18px;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, opacity 0.2s;
    display: inline-block;
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

button:hover,
.button:hover {
    background-color: var(--secondary-color);
}

button:active,
.button:active {
    opacity: 0.85;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 18px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: var(--secondary-color);
}

.add-to-cart-btn.disabled {
    background-color: var(--border-color);
    color: var(--text-color-light);
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Product Grid ─────────────────────────── */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    background: var(--background-color);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.product-card a.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Square image container - full view, not cropped */
.product-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.product-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card-body h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

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

.product-card-body .categories {
    font-size: 0.75rem;
    color: var(--text-color-light);
    margin: 0;
}

.product-card-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color-light);
}

.out-of-stock-badge {
    display: inline-block;
    background: var(--color-danger-light);
    color: var(--color-danger);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.product-quantity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.product-quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-left: 4px;
    margin-right: 4px;
}

.product-quantity-control button {
    all: unset;
    padding: 8px 8px;
    background: var(--background-color);
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: 4px;
    margin: 0 4px 0 4px;
}

.product-quantity-control button:hover {
    background: var(--border-color-light);
}

.product-quantity-control span {
    padding: 8px 6px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
}

/* ===== UTILITY CLASSES ===== */

/* Flex Layout Utilities */
.flex-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== FORM UTILITIES ===== */

/* Form Group - Standard layout for label + input */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.form-group select {
    background-color: white;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Form Container - Card layout for forms */
.form-container {
    background: var(--background-color);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

/* Form Grid - Two-column layout for form inputs */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Form Footer - Divider + text below form */
.form-footer {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color-light);
    padding-top: 15px;
}

.form-footer p {
    margin: 0;
    color: var(--text-color-medium);
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Form Button - Full width submit button */
.form-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}

/* Error Message - Styled error display */
.error-message {
    color: var(--color-danger);
    background: var(--color-danger-light);
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
    font-size: 0.9rem;
}

/* Required Field Indicator */
.form-group.required label::after {
    content: " *";
    color: var(--color-danger);
}

/* Success Message - Styled success display */
.success-message {
    color: #155724;
    background: #d4edda;
    padding: 12px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 16px;
    display: none;
    font-size: 0.9rem;
}

/* Page Content Layout */
.page-content-main {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-content-body {
    margin-top: 24px;
    line-height: 1.8;
    color: var(--text-color);
}

/* Login Page Styles */
.login-title {
    max-width: 400px;
    margin: 40px auto 20px;
    text-align: left;
}

.login-form {
    max-width: 400px;
    position: sticky;
    margin: auto;
    top: 80px;
}

.login-btn {
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Navbar Search Bar */
.navbar-search {
    position: relative;
    display: flex;
    align-items: center;
}

.navbar-search input {
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    width: 0;
    font-size: 0.9rem;
    background: white;
    color: var(--text-color);
    transition: all 0.3s ease;
    opacity: 0;
}

.navbar-search.active input {
    width: 200px;
    padding: 10px 12px 10px 35px;
    border-color: var(--border-color);
    background: white;
    opacity: 1;
}

.navbar-search input::placeholder {
    color: var(--text-color-light);
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.navbar-search i {
    cursor: pointer;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 5;
}

.navbar-search.active i {
    position: absolute;
    left: 10px;
    font-size: 0.9rem;
    color: var(--text-color-light);
}

@media (max-width: 1024px) {
    .navbar-search.active input {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .navbar-search {
        display: none;
    }
}

.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);

    min-width: 280px;
    max-width: 360px;

    padding: 20px;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);

    background: white;
    color: #222;

    display: flex;
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 10px;

    text-align: center;

    opacity: 0;
    transition: all 0.3s ease;

    pointer-events: none;
    z-index: 9999;

    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

#toast-icon {
    font-size: 32px;
}

.notification.show {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.notification .toast-actions {
    display: none;
    gap: 10px;
    margin-top: 12px;
}

.notification.show-confirm .toast-actions {
    display: flex;
}

.toast-btn {
    padding: 8px 14px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
}

.toast-btn-secondary {
    background: var(--background-color-grey);
    color: var(--text-color);
}

.toast-btn-danger {
    background: var(--primary-color);
    color: white;
}

.toast-btn {
    pointer-events: auto;
}

.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    opacity: 0;
    transform: translateY(-20px);
    transition: .3s;
    pointer-events: none;
    z-index: 9999;
}

.cart-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.cart-notification.success {
    background: var(--color-success);
}

.cart-notification.error {
    background: var(--color-danger);
}

@media (max-width: 768px) {
    .cart-notification {
        top: 80px;
        right: auto;
        left: 20px;
        right: 20px;
    }
}