/* ==================== Brand Colors ==================== */
:root {
    --se-blue-900: #1e3a8a;
    --se-blue-800: #1e40af;
    --se-blue-600: #2563eb;
    --se-gray-900: #111827;
    --se-gray-800: #1f2937;
    --se-gray-700: #374151;
    --se-gray-100: #f3f4f6;
    --se-amber-500: #f59e0b;
    --se-amber-600: #d97706;
    --se-green-600: #16a34a;
    --se-red-500: #ef4444;
}

/* ==================== Sticky footer ==================== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main {
    flex: 1;
}

/* ==================== Bootstrap overrides ==================== */
.btn-primary {
    background-color: var(--se-gray-900);
    border-color: var(--se-gray-900);
}
.btn-primary:hover {
    background-color: var(--se-gray-800);
    border-color: var(--se-gray-800);
}

.btn-outline-primary {
    color: var(--se-gray-900);
    border-color: var(--se-gray-900);
}
.btn-outline-primary:hover {
    background-color: var(--se-gray-900);
    border-color: var(--se-gray-900);
}

.bg-light {
    background-color: var(--se-gray-100) !important;
}

.text-primary {
    color: var(--se-gray-900) !important;
}

/* ==================== Store Header ==================== */
.store-header {
    background-color: var(--se-gray-900);
    color: #fff;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.store-header a {
    color: #fff;
    text-decoration: none;
}

.store-header a:hover {
    color: var(--se-amber-500);
}

.store-logo {
    height: 40px;
    width: auto;
}

.store-search {
    max-width: 400px;
}

.store-search .form-control {
    border-radius: 20px 0 0 20px;
    border: none;
}

.store-search .btn {
    border-radius: 0 20px 20px 0;
    background-color: var(--se-amber-500);
    border-color: var(--se-amber-500);
    color: #fff;
}

.cart-badge {
    background-color: var(--se-amber-500);
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    position: relative;
    top: -8px;
    left: -5px;
    font-weight: bold;
}

/* ==================== Category Cards ==================== */
.category-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    padding: 1rem;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-card.active {
    border-color: var(--se-gray-900);
    background-color: var(--se-gray-900);
    color: #fff;
}

/* ==================== Product Cards ==================== */
.product-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.product-card-top {
    position: relative;
}

.product-card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #fff;
    padding: 1rem;
}

/* ==================== Wishlist Buttons ==================== */
.wishlist-btn-card {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s, transform 0.2s;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.wishlist-btn-card:hover {
    color: var(--se-red-500);
    transform: scale(1.1);
}

.wishlist-btn-card.active {
    color: var(--se-red-500);
}

.wishlist-btn-sm {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 2px;
    transition: color 0.2s;
}

.wishlist-btn-sm:hover,
.wishlist-btn-sm.active {
    color: var(--se-red-500);
}

.wishlist-btn {
    transition: color 0.2s;
}

.wishlist-btn.active {
    color: var(--se-red-500) !important;
    border-color: var(--se-red-500) !important;
}

.product-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--se-gray-900);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--se-gray-900);
    margin-bottom: 0.5rem;
}

.product-card-stock {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.product-card-stock.in-stock {
    color: var(--se-green-600);
}

.product-card-stock.out-of-stock {
    color: var(--se-red-500);
}

.product-card-actions {
    margin-top: auto;
}

/* ==================== Product Detail ==================== */
.product-detail-img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 0.75rem;
}

.product-detail-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--se-gray-900);
}

.product-detail-stock {
    font-size: 0.9rem;
}

/* ==================== Cart ==================== */
.cart-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.cart-summary {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    position: sticky;
    top: 80px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.cart-summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    border-top: 2px solid var(--se-gray-900);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

/* ==================== Checkout ==================== */
.checkout-step {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.checkout-step h5 {
    font-weight: 700;
    margin-bottom: 1rem;
}

.delivery-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.delivery-option:hover {
    border-color: var(--se-gray-700);
}

.delivery-option.selected {
    border-color: var(--se-gray-900);
    background-color: rgba(17, 24, 39, 0.03);
}

/* ==================== Shipping Rate Card ==================== */
.shipping-rate-card {
    background: var(--se-gray-100);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

/* ==================== Order Confirmation ==================== */
.order-success {
    text-align: center;
    padding: 3rem 1rem;
}

.order-success-icon {
    font-size: 4rem;
    color: var(--se-green-600);
    margin-bottom: 1rem;
}

/* ==================== Account ==================== */
.account-tabs .nav-link {
    color: var(--se-gray-700);
    font-weight: 600;
}

.account-tabs .nav-link.active {
    color: var(--se-gray-900);
    border-bottom: 2px solid var(--se-gray-900);
}

.order-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.order-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.order-status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status-badge.confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.order-status-badge.shipped {
    background: #e0e7ff;
    color: #3730a3;
}

.order-status-badge.delivered {
    background: #dcfce7;
    color: #166534;
}

.order-status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* ==================== Dialog ==================== */
dialog {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 400px;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ==================== Store Footer ==================== */
.store-footer {
    background-color: var(--se-gray-900);
    color: #ccc;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.store-footer a {
    color: #ccc;
    text-decoration: none;
}

.store-footer a:hover {
    color: var(--se-amber-500);
}

.store-footer-bottom {
    border-top: 1px solid var(--se-gray-700);
    padding-top: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    text-align: center;
}

/* ==================== Language buttons ==================== */
.lang-btn {
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: transparent;
    color: #fff;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* ==================== Mobile Offcanvas Menu ==================== */
.store-offcanvas {
    background-color: var(--se-gray-900);
    color: #fff;
    max-width: 280px;
}

.store-offcanvas-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.store-offcanvas-link:hover {
    background: rgba(255,255,255,0.1);
    color: var(--se-amber-500);
}

.cart-badge-menu {
    background-color: var(--se-amber-500);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: auto;
}

.lang-btn-mobile {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-weight: 500;
    transition: background 0.2s;
}

.lang-btn-mobile:hover {
    background: rgba(255,255,255,0.1);
}

/* ==================== Loading ==================== */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* ==================== Pagination ==================== */
.store-pagination .page-link {
    color: var(--se-gray-900);
}

.store-pagination .page-item.active .page-link {
    background-color: var(--se-gray-900);
    border-color: var(--se-gray-900);
    color: #fff;
}

/* ==================== Toast notification ==================== */
.store-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--se-gray-900);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}

.store-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== Admin Panel ==================== */
.admin-stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--se-gray-900);
    line-height: 1.2;
}

.admin-stat-label {
    font-size: 0.8rem;
    color: var(--se-gray-700);
    margin-top: 0.25rem;
}

.admin-stat-small {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    text-align: left;
}

.admin-stat-small .admin-stat-label {
    margin-top: 0;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .store-search {
        max-width: 100%;
        margin-top: 0.5rem;
    }

    .product-card-img {
        height: 150px;
    }

    .product-detail-img {
        max-height: 200px;
    }

    .cart-item-img {
        width: 60px;
        height: 60px;
    }

    /* Cart items: stack vertically on mobile */
    .cart-item {
        flex-wrap: wrap;
    }

    .cart-item .cart-item-controls {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    /* Wishlist cards: stack on mobile */
    .wishlist-card {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .wishlist-card .wishlist-card-actions {
        align-self: flex-end;
    }
}

@media (max-width: 576px) {
    .store-header .container {
        padding: 0 0.5rem;
    }

    .store-header #store-name {
        font-size: 1rem !important;
    }

    .product-card-price {
        font-size: 1rem;
    }

    .product-detail-price {
        font-size: 1.25rem;
    }
}
