/* =========================================
   STARPET - Shop & Drawer Styles
   ========================================= */

.shop-main {
    padding-top: 100px; /* Offset for sticky nav */
}

.shop-hero {
    padding: 3rem 0;
}

/* --- Filter Bar --- */
.filter-bar {
    background-color: var(--clr-bg-white);
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 60px; /* Below the sticky nav */
    z-index: 90;
}

.filter-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 1rem 1.5rem;
}
.filter-container::-webkit-scrollbar { display: none; }

.filter-btn {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--clr-text-muted);
    white-space: nowrap;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-btn.active, .filter-btn:hover {
    color: var(--clr-cta-orange);
    border-bottom-color: var(--clr-cta-orange);
}

/* --- Product Grid --- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--clr-bg-white);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.product-img {
    background-color: var(--clr-bg-gray);
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.product-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-family: var(--font-heading);
    color: var(--clr-text-muted);
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.product-card .btn {
    margin-top: auto;
}

/* --- Drawers & Overlay --- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 54, 93, 0.6); /* Navy blue tint */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed);
}
.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    background-color: var(--clr-bg-white);
    z-index: 1001;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.drawer.open { right: 0; }

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    font-size: 1.125rem;
    color: var(--clr-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-drawer {
    font-size: 2rem;
    line-height: 1;
    color: var(--clr-primary-navy);
    cursor: pointer;
}

/* Product Details specific */
.drawer-img-placeholder {
    background-color: var(--clr-bg-gray);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-body {
    padding: 2rem 1.5rem;
    overflow-y: auto;
}

.pd-title { font-size: 2rem; margin-bottom: 0.5rem; }
.pd-price { font-size: 1.5rem; font-weight: 700; color: var(--clr-cta-orange); margin-bottom: 1.5rem; }
.pd-desc { color: var(--clr-text-muted); margin-bottom: 2rem; }

/* Cart specific */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.empty-cart-msg {
    text-align: center;
    color: var(--clr-text-muted);
    margin-top: 2rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    background-color: var(--clr-bg-gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-details { flex-grow: 1; }
.cart-item-title { font-weight: 700; color: var(--clr-primary-navy); margin-bottom: 0.25rem; }
.cart-item-price { font-size: 0.875rem; color: var(--clr-text-muted); margin-bottom: 0.5rem; }
.remove-item { font-size: 0.75rem; color: #EF4444; text-decoration: underline; cursor: pointer; }

.checkout-section {
    padding: 1.5rem;
    border-top: 1px solid #E5E7EB;
    background-color: var(--clr-bg-gray);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--clr-primary-navy);
}

/* =========================================
   REFINED CHECKOUT & MOBILE DRAWER UI
   ========================================= */
.checkout-section {
    padding: 1.5rem;
    border-top: 1px solid #E5E7EB;
    background-color: var(--clr-bg-gray);
    margin-top: auto; /* Pushes checkout to the very bottom of the drawer */
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03); /* Adds subtle depth above the form */
    position: relative;
    z-index: 10;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Fixes vertical misalignment between "Total" and the price */
    font-weight: 800;
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    color: var(--clr-primary-navy);
}

.checkout-form .form-group {
    margin-bottom: 1rem;
}

.checkout-form .form-group input {
    width: 100%;
    padding: 1rem 1.125rem; /* Larger touch targets for mobile thumbs */
    background-color: var(--clr-bg-white);
    border: 1px solid #D1D5DB; /* Slightly sharper border for high contrast */
    border-radius: var(--radius-sm);
    font-size: 1rem; /* CRITICAL: 16px prevents iOS Safari auto-zoom */
    color: var(--clr-primary-navy);
    transition: all var(--transition-speed);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02); /* App-like inner depth */
}

.checkout-form .form-group input:focus {
    border-color: var(--clr-cta-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.checkout-form .form-group input::placeholder {
    color: #9CA3AF;
}

/* Make the checkout button a massive, unmissable touch target */
.checkout-form .btn-block {
    padding: 1.125rem;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

/* --- Mobile Specific Overrides --- */
@media (max-width: 768px) {
    .drawer {
        max-width: 100%; /* Ensure drawer takes the full screen width on phones */
    }
    
    .checkout-section {
        padding: 1.25rem 1.25rem 2rem 1.25rem; /* Extra bottom padding for the iOS swipe bar */
    }
}