/* ==========================================================================
   BREADCRUMB STYLING (Responsive & Padded)
   ========================================================================== */
.shop-breadcrumb {
    background-color: #f1f5f9; /* Subtle light gray background, not white */
    padding: 15px 25px;
    border-radius: 8px;
    margin: 20px auto 30px auto;
    max-width: 1200px;
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on mobile screens */
    gap: 8px;
    align-items: center;
    box-sizing: border-box;
}

.shop-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shop-breadcrumb a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.current-category, .current-product {
    color: #0f172a;
    font-weight: 600;
}

/* ==========================================================================
   MAIN STOREFRONT LAYOUT (Desktop First, Mobile Adapted)
   ========================================================================== */
.shop-container {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
    gap: 30px;
    box-sizing: border-box;
}

/* Sidebar Sizing */
.shop-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.shop-sidebar h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.shop-categories, .shop-categories ul {
    list-style: none;
    padding-left: 0;
}

.shop-categories ul {
    padding-left: 15px;
    margin: 5px 0;
    border-left: 1px solid #e2e8f0; /* Visual hierarchy line */
}

.shop-categories a {
    display: block;
    padding: 6px 0 6px 10px;
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.shop-categories a:hover, .shop-categories a.active {
    color: #2563eb;
    font-weight: 600;
}

/* Main Shop Content Area */
.shop-main {
    flex: 1;
    min-width: 0; /* Prevents grid blowout on smaller screens */
}

.shop-header {
    margin-bottom: 25px;
}

/* ==========================================================================
   PRODUCT GRID & CARDS
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.product-image-wrapper {
    width: 100%;
    height: 220px;
    background-color: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.store-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.store-product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-summary {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

/* Price & Buy Action Split Row */
.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap; /* Crucial: Allows the button to drop below price if cramped */
    gap: 12px;
}

.store-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
}

/* Form wrapper to ensure it doesn't break flex layout */
.product-meta-row form {
    margin: 0;
}

.btn-add-cart {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap; /* Prevents text from stacking vertically */
    display: inline-block;
    width: 100%;
}

.btn-add-cart:hover {
    background-color: #1d4ed8;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Media Queries)
   ========================================================================== */

/* Tablet & Smaller Devices */
@media (max-width: 850px) {
    .shop-container {
        flex-direction: column; /* Stacks sidebar on top of products */
        gap: 20px;
    }
    
    .shop-sidebar {
        width: 100%; /* Sidebar takes full width */
        background: #f8fafc;
        padding: 15px;
        border-radius: 8px;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr; /* Forces 1 product per row on small phones */
    }

    .shop-breadcrumb {
        padding: 12px 15px;
        font-size: 0.85rem;
    }

    .product-meta-row {
        flex-direction: column;
        align-items: flex-start; /* Stacks price and button */
    }

    .product-meta-row form, .btn-add-cart {
        width: 100%; /* Makes button full width on mobile for easy tapping */
    }
}

/* ==========================================================================
   PRODUCT DETAIL PAGE LAYOUT (product-detail.php)
   ========================================================================== */
.product-detail-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
    gap: 50px;
    align-items: flex-start;
}

/* Left Column: Media Showcase */
.detail-media-gallery {
    flex: 1;
    max-width: 550px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-display-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

/* Right Column: Details & Cart Action */
.detail-specs-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.detail-sku {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.detail-price-box {
    margin-bottom: 25px;
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.current-price {
    font-size: 2rem;
    font-weight: 800;
    color: #2563eb;
}

.old-price {
    font-size: 1.2rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.detail-description {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
}

/* Purchase Actions */
.purchase-action-zone {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quantity-selector label {
    font-weight: 600;
    color: #0f172a;
}

.quantity-selector input[type="number"] {
    width: 80px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
}

.btn-purchase-primary {
    width: 100%;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-purchase-primary:hover {
    background-color: #1d4ed8;
}

.btn-purchase-primary:active {
    transform: scale(0.98);
}

/* Detail Page Mobile Responsiveness */
@media (max-width: 900px) {
    .product-detail-layout {
        flex-direction: column;
        gap: 30px;
    }

    .detail-media-gallery {
        max-width: 100%;
        width: 100%;
    }
    
    .detail-title {
        font-size: 1.8rem;
    }
}