:root {
    --shop-primary: #3273dc;
    --shop-primary-hover: #276cda;
    --shop-accent: #27ae60;
    --shop-text: #2c3e50;
    --shop-text-light: #95a5a6;
    --shop-bg-light: #f4f6f8;
    --shop-shadow: rgba(0, 0, 0, 0.05);
    --shop-radius: 16px;
}

/* Shop Grid */
.shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.shop-header {
    margin-bottom: 30px;
    text-align: center;
}

.shop-header .title {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.shop-header .subtitle {
    color: #666;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.shop-card {
    border: none;
    border-radius: var(--shop-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px var(--shop-shadow);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.shop-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.shop-card-img {
    height: 260px;
    overflow: hidden;
    position: relative;
    background: #f4f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.shop-card:hover .shop-card-img img {
    transform: scale(1.08);
}

.shop-card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shop-card-category {
    font-size: 0.75rem;
    color: var(--shop-text-light);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
    font-weight: 600;
}

.shop-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--shop-text);
}

.shop-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.shop-card-title a:hover {
    color: var(--shop-primary);
}

.shop-card-price {
    color: var(--shop-accent);
    font-weight: 800;
    font-size: 1.35rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.shop-card-action {
    margin-top: auto;
}

.shop-card-action .button {
    background-color: var(--shop-primary);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    height: 44px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    border: none;
}

.shop-card-action .button:hover {
    background-color: var(--shop-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* Pagination */
.shop-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.shop-pagination .pagination-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 50px;
    color: var(--shop-text-light);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.shop-pagination .pagination-link.is-current {
    background: var(--shop-primary);
    color: #fff;
    border-color: var(--shop-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.shop-pagination .pagination-link:hover:not(.is-current) {
    border-color: #bdc3c7;
    color: var(--shop-text);
    background: #f8f9fa;
}

/* Cart Badge */
.cart-badge-wrapper .icon {
    position: relative;
}

.cart-count-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #fff;
    color: var(--shop-primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Admin Modals */
#shopAdminModal .modal-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
}

#shopAdminModal .modal-title {
    color: #1a202c;
    font-weight: 700;
}

#shopAdminModal .close {
    color: #1a202c;
    opacity: 0.5;
}

#shopAdminModal .close:hover {
    opacity: 1;
}

/* Admin Tabs */
.shop-admin-tabs {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    display: flex;
    background: #fff;
}

.shop-admin-tab {
    padding: 15px 25px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    color: #718096;
    font-weight: 500;
    transition: all 0.2s ease;
}

.shop-admin-tab:hover {
    color: #4a5568;
    background: #f7fafc;
}

.shop-admin-tab.active {
    border-bottom-color: #3273dc;
    color: #3273dc;
    font-weight: 700;
    background: #fff;
}

/* Admin Content */
.shop-admin-panel {
    display: none;
    padding: 20px;
}

.shop-admin-panel.active {
    display: block;
}

.shop-admin-panel h2.title {
    color: #2d3748;
}

/* Table Visibility Fixes */
.table th {
    color: #4a5568 !important;
    background: #f8fafc;
}

.table td {
    color: #2d3748;
    vertical-align: middle;
}

/* Sub-Modal Styling (Product/Category) */
.modal-card-head {
    background-color: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.modal-card-title {
    color: #1a202c !important;
    font-weight: 700 !important;
}

.modal-card-body label.label {
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-card-body .input,
.modal-card-body .textarea,
.modal-card-body .select select {
    border-color: #e2e8f0;
    box-shadow: none;
    color: #2d3748;
}

.modal-card-body .input:focus,
.modal-card-body .textarea:focus {
    border-color: #3273dc;
    box-shadow: 0 0 0 0.125em rgba(50, 115, 220, 0.25);
}

.modal-card-foot {
    background-color: #f8fafc;
    border-top: 1px solid #edf2f7;
}

/* Checkout Layout - Sticky Order Summary */
.shop-checkout-columns {
    align-items: flex-start;
    /* Required for sticky to work inside flex/grid */
}

/* Desktop: Order Summary on the right, sticky */
.shop-order-summary-col {
    order: 2;
    position: sticky;
    top: 50px;
}

/* Desktop: Checkout form on the left */
.shop-checkout-form-col {
    order: 1;
}

/* Mobile Place Order button - hidden on desktop */
.shop-place-order-mobile {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .shop-card-img {
        height: 220px;
    }

    .shop-container {
        padding: 15px;
    }

    /* Mobile: Form first, Order Summary after (before checkout button) */
    .shop-checkout-columns {
        display: flex !important;
        flex-direction: column !important;
    }

    .shop-checkout-form-col {
        order: 1;
        width: 100%;
    }

    .shop-order-summary-col {
        order: 2;
        width: 100%;
        position: static;
        /* Disable sticky on mobile */
        top: auto;
    }

    /* Mobile: Hide Place Order inside form, show the one below Order Summary */
    .shop-place-order-desktop {
        display: none !important;
    }

    .shop-place-order-mobile {
        display: block;
        padding: 0 15px 30px;
    }
}

/* Shop Hero Visibility Fix */
.shop-page-wrapper .hero .hero-body {
    background-color: transparent;
    padding: 3rem 1.5rem;
}

.shop-page-wrapper .hero .hero-body .title,
.shop-page-wrapper .hero .hero-body .subtitle {
    color: #1a202c !important;
}

.shop-page-wrapper .hero .hero-body .subtitle {
    opacity: 0.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Admin Button Overlay */
.shop-admin-button-container {
    padding: 30px 0;
    display: flex;
    justify-content: center;
    background: transparent;
    margin-bottom: 10px;
    position: relative;
    z-index: 10;
}

.shop-admin-manage-btn {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 18px 45px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4), 0 10px 15px -10px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.shop-admin-manage-btn:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 25px 40px -10px rgba(0, 0, 0, 0.5), 0 15px 20px -15px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #fff !important;
}

.shop-admin-manage-btn i {
    font-size: 1.4rem;
    color: #fbbf24;
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.4));
}