/* ==========================================================================
   1. BASE VARIABLES & TYPOGRAPHY
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
   --primary-blue-color: #137fec;
   --primary-blue-hover: #0e5fb0;
   --background-light-color: #f8fafc;
   --surface-white-color: #ffffff;
   --text-dark-color: #1e293b;
   --text-muted-color: #64748b;
   --border-light-color: #e2e8f0;
   --danger-red-color: #ef4444;
   --success-green-color: #10b981;
   --warning-orange-color: #f59e0b;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Lexend', sans-serif; }
html { scroll-behavior: smooth; }
body { background-color: var(--background-light-color); color: var(--text-dark-color); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ==========================================================================
   2. GLOBAL HEADER NAVIGATION
   ========================================================================== */
.main-navigation-header { background-color: var(--surface-white-color); border-bottom: 1px solid var(--border-light-color); position: sticky; top: 0; z-index: 100; }
.navigation-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; height: 80px; }

.brand-logo-container { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; color: var(--text-dark-color); }
.brand-logo-image { height: 45px; width: auto; object-fit: contain; }

.navigation-links { display: flex; gap: 30px; font-weight: 500; }
.navigation-links a:hover, .navigation-links a.active { color: var(--primary-blue-color); }
.search-and-actions-container { display: flex; align-items: center; gap: 20px; }
.search-input-field { padding: 10px 15px 10px 40px; border-radius: 20px; border: 1px solid var(--border-light-color); background-color: var(--background-light-color); width: 320px; transition: width 0.3s; font-size: 13px; }
.search-input-wrapper { position: relative; }
.search-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted-color); font-size: 20px; }
.shopping-cart-button { position: relative; background: none; border: none; cursor: pointer; font-size: 24px; color: var(--text-muted-color); }
.cart-item-count-badge { position: absolute; top: -5px; right: -10px; background-color: var(--primary-blue-color); color: var(--surface-white-color); font-size: 12px; font-weight: bold; border-radius: 50%; padding: 2px 6px; }

/* ==========================================================================
   3. GLOBAL UI COMPONENTS (Buttons & Utilities)
   ========================================================================== */
.back-to-top-button {
   display: none; position: fixed; bottom: 30px; right: 30px; background-color: var(--primary-blue-color); color: var(--surface-white-color);
   width: 45px; height: 45px; border-radius: 50%; border: none; cursor: pointer; align-items: center; justify-content: center;
   box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 999; transition: background-color 0.3s;
}
.back-to-top-button:hover { background-color: var(--primary-blue-hover); }

/* ==========================================================================
   4. PRODUCT GRID & CARDS
   ========================================================================== */
.section-container { max-width: 1200px; margin: 60px auto; padding: 0 20px; }
.section-title-wrapper { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end;}
.section-title { font-size: 24px; font-weight: 700; } 
.section-subtitle { color: var(--text-muted-color); font-size: 12px; margin-top: 4px; }
.view-all-link { color: var(--primary-blue-color); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 4px; }

.product-grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.product-card-container { background-color: var(--surface-white-color); border: 1px solid var(--border-light-color); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.2s ease; }
.product-card-container:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.05); }

.product-image-wrapper { height: 240px; background-color: #f1f5f9; display: flex; justify-content: center; align-items: center; padding: 15px; }
.product-image { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.product-status-badge { position: absolute; top: 10px; left: 10px; background-color: var(--surface-white-color); padding: 3px 6px; font-size: 10px; font-weight: 700; border-radius: 4px; }

.product-details-wrapper { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.product-category-label { color: var(--primary-blue-color); font-size: 10px; font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.product-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.product-author-brand { color: var(--text-muted-color); font-size: 11px; margin-bottom: 8px; }

.product-stats-container { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
.stat-sold { color: var(--primary-blue-color); }
.stat-stock { color: var(--success-green-color); }

.product-short-description { color: var(--text-muted-color); font-size: 11px; margin-bottom: 15px; flex-grow: 1; }

.product-price-and-action { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-light-color); padding-top: 12px; }
.product-price { font-size: 18px; font-weight: 700; color: var(--text-dark-color); }
.add-to-cart-button { background-color: var(--primary-blue-color); color: var(--surface-white-color); border: none; padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: background-color 0.2s ease; width: 100%; }
.add-to-cart-button:hover { background-color: var(--primary-blue-hover); }

/* ==========================================================================
   5. CATALOG PAGE (Sidebar, Filters, Pagination)
   ========================================================================== */
.catalog-layout-container { display: flex; gap: 30px; max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.catalog-sidebar-filter { width: 220px; flex-shrink: 0; }
.filter-section-title { font-size: 13px; color: var(--text-muted-color); text-transform: uppercase; margin-bottom: 12px; font-weight: 700; }
.filter-options-list li { padding: 8px 0; font-size: 14px; color: var(--text-muted-color); cursor: pointer; transition: color 0.2s; }
.filter-options-list li:hover, .filter-options-list li.active-filter { color: var(--primary-blue-color); font-weight: 700; }
.catalog-main-content { flex-grow: 1; }

.price-action-group { display: flex; gap: 8px; }
.button-apply { flex: 1; background-color: var(--primary-blue-color); color: var(--surface-white-color); border: none; padding: 8px; border-radius: 6px; font-weight: 600; font-size: 12px; cursor: pointer; transition: background 0.2s; }
.button-apply:hover { background-color: var(--primary-blue-hover); }
.button-reset { flex: 1; background-color: var(--border-light-color); color: var(--text-dark-color); border: none; padding: 8px; border-radius: 6px; font-weight: 600; font-size: 12px; cursor: pointer; transition: background 0.2s; }
.button-reset:hover { background-color: #cbd5e1; }

.pagination-container { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-light-color); }
.page-button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--border-light-color); background: var(--surface-white-color); color: var(--text-muted-color); cursor: pointer; font-weight: 600; font-size: 14px; transition: all 0.2s; }
.page-button:hover:not(:disabled) { background: var(--background-light-color); color: var(--primary-blue-color); border-color: var(--primary-blue-color); }
.page-button.active { background: var(--primary-blue-color); color: var(--surface-white-color); border-color: var(--primary-blue-color); }
.page-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==========================================================================
   6. SHOPPING CART PAGE
   ========================================================================== */
.cart-layout-container { display: flex; gap: 30px; max-width: 1200px; margin: 20px auto 60px; padding: 0 20px; }
.cart-items-section { flex-grow: 1; }

.cart-table-header { 
   display: grid; grid-template-columns: 4fr 1fr 1fr 1.2fr; gap: 10px;
   padding: 0 15px 10px 15px; margin-bottom: 15px; 
   font-weight: 700; font-size: 13px; color: var(--text-muted-color); 
   height: 35px; align-items: flex-end;
}

.cart-item-row { 
   display: grid; grid-template-columns: 4fr 1fr 1fr 1.2fr; gap: 10px; align-items: center; 
   padding: 15px; margin-bottom: 10px; border-radius: 8px;
   border: 2px solid var(--primary-blue-color); 
   background-color: var(--surface-white-color);
   transition: border-color 0.3s ease; 
}
.cart-item-row.omitted-from-order { border-color: var(--border-light-color); opacity: 1; }

.cart-item-product-col { display: flex; gap: 15px; align-items: center; }
.cart-item-image { width: 70px; height: 100px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.cart-item-details { flex-grow: 1; }
.cart-item-stock { font-size: 11px; color: var(--text-muted-color); margin-top: 4px; }

.cart-item-action-buttons { display: flex; gap: 15px; align-items: center; margin-top: 8px; }
.cart-item-toggle-button { background: none; border: none; cursor: pointer; font-size: 12px; display: flex; align-items: center; font-weight: 600; }
.cart-item-toggle-button.remove-button { color: var(--danger-red-color); }
.cart-item-toggle-button.add-button { color: var(--success-green-color); }
.cart-item-delete-button { color: var(--text-muted-color); background: none; border: none; cursor: pointer; font-size: 12px; display: flex; align-items: center; font-weight: 500; transition: color 0.2s; }
.cart-item-delete-button:hover { color: var(--danger-red-color); }

.cart-quantity-selector { display: flex; align-items: center; justify-self: center; border: 1px solid var(--border-light-color); border-radius: 6px; overflow: hidden; background: white; }
.quantity-button { background: none; border: none; padding: 4px 8px; cursor: pointer; font-size: 14px; transition: background 0.2s; }
.quantity-button:hover { background: var(--background-light-color); }
.quantity-input-field { width: 45px; text-align: center; border: none; font-weight: 600; background: transparent; font-size: 13px; padding: 4px 0; outline: none; }
.quantity-input-field::-webkit-outer-spin-button, .quantity-input-field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quantity-input-field[type=number] { appearance: textfield; }

.cart-summary-wrapper { width: 320px; align-self: flex-start; scroll-margin-top: 100px; }
.cart-summary-header { font-size: 18px; font-weight: 700; padding-bottom: 10px; margin-bottom: 15px; height: 35px; display: flex; align-items: flex-end; }
.cart-summary-section { background-color: var(--surface-white-color); padding: 20px; border-radius: 12px; border: 1px solid var(--border-light-color); height: max-content; }

.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }

.checkout-payment-methods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.checkout-payment-method { border: 2px solid var(--border-light-color); border-radius: 6px; padding: 4px; height: 35px; width: 52px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.2s; background-color: white; }
.checkout-payment-method.selected { border-color: var(--primary-blue-color); background-color: #f0f8ff; }
.checkout-payment-method img { max-height: 100%; max-width: 100%; object-fit: contain; }

.summary-total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border-light-color); }
.checkout-button { width: 100%; background-color: var(--primary-blue-color); color: var(--surface-white-color); padding: 12px; border: none; border-radius: 6px; font-weight: 700; margin-top: 15px; cursor: pointer; transition: background 0.2s; font-size: 13px;}
.checkout-button:hover { background-color: var(--primary-blue-hover); }

.mobile-checkout-bar { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background-color: var(--surface-white-color); border-top: 1px solid var(--border-light-color); padding: 15px 20px; box-shadow: 0 -4px 12px rgba(0,0,0,0.05); z-index: 1000; align-items: center; justify-content: space-between; transition: transform 0.3s ease, opacity 0.3s ease; }
.mobile-checkout-bar .total-wrapper { display: flex; flex-direction: column; }
.mobile-checkout-bar .total-label { font-size: 12px; color: var(--text-muted-color); font-weight: 500; }
.mobile-checkout-bar .total-price { font-size: 18px; font-weight: 700; color: var(--primary-blue-color); }
.mobile-checkout-bar .checkout-button { width: auto; padding: 12px 25px; margin-top: 0; }

/* ==========================================================================
   7. ABOUT US PAGE
   ========================================================================== */
.about-hero-section { 
   background-image: linear-gradient(rgba(19, 31, 51, 0.40), rgba(19, 31, 51, 0.55)), url('../images/our-story-background.jpg');
   background-size: cover;
   background-position: center;
   padding: 120px 20px; 
   border-bottom: 1px solid var(--border-light-color); 
   text-align: center; 
}
.about-hero-title { font-size: 54px; font-weight: 700; margin-bottom: 20px; color: var(--surface-white-color); }
.about-hero-subtitle { font-size: 20px; color: #f1f5f9; max-width: 800px; margin: 0 auto; line-height: 1.6; }

.about-mission-section { max-width: 1200px; margin: 80px auto; padding: 0 20px; display: flex; gap: 60px; align-items: center; }
.about-mission-image { flex: 1; }
.about-mission-image img { width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.about-mission-content { flex: 1; }
.mission-badge { background-color: #e0f2fe; color: var(--primary-blue-color); padding: 6px 14px; border-radius: 20px; font-size: 20px; font-weight: 700; text-transform: uppercase; }

.mission-title { font-size: 42px; font-weight: 700; margin: 25px 0; line-height: 1.2; }
.mission-text { color: var(--text-muted-color); font-size: 18px; margin-bottom: 20px; line-height: 1.7; }

.about-values-section { background-color: #f1f5f9; padding: 100px 20px; text-align: center; }
.values-title { font-size: 36px; font-weight: 700; margin-bottom: 15px; }
.values-subtitle { color: var(--text-muted-color); font-size: 18px; margin-bottom: 60px; }
.values-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; max-width: 1200px; margin: 0 auto; }
.value-card { background-color: white; padding: 50px; border-radius: 16px; text-align: left; box-shadow: 0 4px 6px rgba(0,0,0,0.02); }
.value-icon { color: var(--primary-blue-color); font-size: 48px; margin-bottom: 25px; }
.value-card-title { font-size: 24px; font-weight: 700; margin-bottom: 15px; }
.value-card-text { color: var(--text-muted-color); font-size: 15px; line-height: 1.6; }

/* ==========================================================================
   8. GLOBAL FOOTER
   ========================================================================== */
.main-footer-container { background-color: var(--surface-white-color); border-top: 1px solid var(--border-light-color); padding: 50px 20px 20px; margin-top: 50px; }
.footer-columns-wrapper { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 30px; }
.footer-brand-description { color: var(--text-muted-color); font-size: 13px; margin-top: 15px; max-width: 300px; }
.footer-column-title { font-size: 15px; font-weight: 700; margin-bottom: 15px; }
.footer-link-list li { margin-bottom: 10px; font-size: 13px; color: var(--text-muted-color); }
.payment-methods-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-logo-image { height: 35px; width: 52px; border: 1px solid var(--border-light-color); border-radius: 4px; padding: 4px; background-color: white; object-fit: contain; }
.footer-copyright { max-width: 1200px; margin: 0 auto; padding-top: 20px; border-top: 1px solid var(--border-light-color); text-align: center; color: var(--text-muted-color); font-size: 12px; }

/* ==========================================================================
   9. RESPONSIVE DESIGN (Mobile & Tablet Adaptations)
   ========================================================================== */

@media (max-width: 992px) {
   .catalog-layout-container { flex-direction: column; }
   .catalog-sidebar-filter { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
   .filter-group .filter-section-title { margin-top: 0 !important; }
   
   .cart-layout-container { flex-direction: column; }
   .cart-summary-wrapper { width: 100%; position: static; margin-top: 20px; }
   
   .about-mission-section { flex-direction: column; text-align: center; }
   
   .footer-columns-wrapper { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}

@media (max-width: 768px) {
   body { padding-bottom: 0px; }

   .navigation-container { flex-wrap: wrap; height: auto; padding: 15px; justify-content: center; gap: 15px; }
   .brand-logo-container { width: 100%; justify-content: center; }
   .navigation-links { width: 100%; justify-content: center; gap: 15px; margin-top: 5px; font-size: 14px; }
   .search-and-actions-container { width: 100%; justify-content: space-between; }
   .search-input-wrapper { flex-grow: 1; }
   .search-input-field { width: 100%; }

   .about-hero-section { padding: 60px 20px; }
   .about-hero-title { font-size: 36px; }
   .about-hero-subtitle { font-size: 16px; }
   .about-mission-section { margin: 40px auto; }
   
   .mission-title { font-size: 32px; }
   .mission-text { font-size: 16px; }

   .catalog-sidebar-filter { grid-template-columns: 1fr; gap: 20px; }

   .product-grid-layout { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
   .product-image-wrapper { height: 200px; }

   .cart-table-header { display: none !important; } 
   .cart-item-row { display: grid; grid-template-columns: 75px 1fr; gap: 15px; align-items: start; }
   .cart-item-product-col { display: contents; } 
   .cart-item-image { width: 75px; height: 105px; margin: 0; }
   .cart-item-details { width: 100%; }
   .cart-item-price-col { display: none !important; } 
   .cart-quantity-selector { grid-column: 2; justify-self: start; margin-top: 5px; }
   .cart-item-total-col { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; border-top: 1px dashed var(--border-light-color); padding-top: 12px; margin-top: 5px; width: 100% !important; text-align: right !important;}
   .cart-item-total-col::before { content: "Item Total: "; font-weight: 500; color: var(--text-muted-color); font-size: 13px; margin-right: auto; }
   
   .footer-columns-wrapper { grid-template-columns: 1fr; }
   .footer-brand-description { max-width: 100%; }
   
   .mobile-checkout-bar { display: flex; }
   .cart-page-body .back-to-top-button { bottom: 100px; }
}