/* ============================================
   OGEN E-COMMERCE - MODERN CLEAN CSS (FIXED)
   White Background | Black + Orange Accents
   Full Width Sections | No Border Radius
   FIXED: Mobile overflow & hidden notifications
   ============================================ */

/* ---------- GLOBAL RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #111111;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Full width container - inner content constrained */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    overflow-x: hidden;
}

/* Sections are full width with background */
section {
    width: 100%;
    padding: 60px 0;
    overflow-x: hidden;
}

/* Alternating section backgrounds for visual separation */
section:nth-child(even) {
    background-color: #ffffff;
}

section:nth-child(odd) {
    background-color: #fafafa;
}

/* Hero slider special handling */
.hero-slider {
    padding: 0;
    background: #111111;
    overflow-x: hidden;
}


/* ---------- COLOR VARIABLES ---------- */
:root {
    --white: #ffffff;
    --black: #111111;
    --black-light: #222222;
    --black-lighter: #333333;
    --orange: #f97316;
    --orange-dark: #ea580c;
    --orange-light: #ffedd5;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
}

/* ---------- BUTTON STYLES - Orange & Black ---------- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: var(--orange);
    border-color: var(--orange);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--orange-dark);
    border-color: var(--orange-dark);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--black);
    color: var(--black);
}

.btn-outline:hover {
    background-color: var(--black);
    color: var(--white);
}

.btn-outline-light {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-outline-light:hover {
    background-color: var(--white);
    color: var(--black);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ---------- SECTION HEADERS ---------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--black);
    margin: 0;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--orange);
}

.view-all-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--orange);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s ease;
}

.view-all-link:hover {
    gap: 12px;
    text-decoration: underline;
}

/* ---------- PRODUCT GRIDS ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 16px;
}

/* ---------- PRODUCT CARDS ---------- */
.product-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.product-img {
    position: relative;
    overflow: hidden;
    background-color: var(--gray-100);
    aspect-ratio: 1 / 1;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img img {
    transform: scale(1.03);
}

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 2;
}

.badge {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-danger {
    background-color: var(--orange);
    color: var(--white);
}

.badge-warning {
    background-color: var(--black);
    color: var(--white);
}

.badge-success {
    background-color: var(--orange-dark);
    color: var(--white);
}

/* ---------- PRODUCT ACTIONS - FIXED FOR MOBILE ---------- */
.product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

/* Desktop: hidden until hover */
@media (min-width: 769px) {
    .product-actions {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .product-card:hover .product-actions {
        opacity: 1;
    }
}

.action-btn {
    width: 38px;
    height: 38px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--black);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.action-btn:hover {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}

.product-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-title a {
    color: var(--black);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--orange);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.product-weight,
.product-supplier {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 12px;
}

.product-rating i {
    color: var(--orange);
}

.product-rating .far.fa-star {
    color: var(--gray-300);
}

.product-rating small {
    color: var(--gray-500);
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--orange);
    margin-bottom: 16px;
}

.product-old-price {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: 10px;
}

/* ---------- CATEGORY CARDS ---------- */
.category-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.2s ease;
    display: block;
    text-decoration: none;
}

.category-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.category-img {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--gray-100);
}

.category-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-img img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--orange);
    color: var(--white);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.category-body {
    padding: 18px;
    text-align: center;
}

.category-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--black);
}

/* ---------- HERO SLIDER (Full Width) ---------- */
.hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--black);
}

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slide {
    display: none;
    position: relative;
    width: 100%;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 550px;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}

.slide-content {
    position: absolute;
    bottom: 15%;
    left: 8%;
    max-width: 520px;
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(2px);
    padding: 32px 36px;
    border-left: 4px solid var(--orange);
}

.slide-tag {
    display: inline-block;
    background: var(--orange);
    color: var(--white);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.slide-content h2 {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 18px;
    color: var(--white);
    line-height: 1.2;
}

.slide-content p {
    font-size: 16px;
    margin-bottom: 28px;
    color: var(--gray-200);
}

.slide-content .highlight {
    font-weight: 700;
    color: var(--orange);
}

.slide-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    pointer-events: none;
}

.slider-arrow {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: all 0.2s ease;
    color: var(--black);
    font-weight: bold;
}

.slider-arrow:hover {
    background: var(--orange);
    color: var(--white);
}

.slider-dots {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-dot.active {
    background: var(--orange);
    width: 32px;
}

.slide-counter {
    position: absolute;
    bottom: 24px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ---------- SEARCH RESULTS SECTION ---------- */
.search-results-section {
    padding: 50px 0 70px;
    background: var(--white);
    width: 100%;
}

.search-header {
    margin-bottom: 32px;
}

.search-header .section-title {
    font-size: 32px;
    margin-bottom: 12px;
}

.search-header .section-title::after {
    bottom: -10px;
}

#search-summary p {
    color: var(--gray-500);
    font-size: 15px;
    margin-top: 16px;
}

/* Loading States */
.loading-indicator {
    text-align: center;
    padding: 50px 0;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--orange);
    margin: 0 auto 15px;
    animation: spin 0.8s linear infinite;
    border-radius: 50%;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 70px 0;
    color: var(--gray-500);
}

.error-state {
    text-align: center;
    padding: 70px 0;
}

.error {
    color: var(--orange);
    font-weight: 500;
}

.end-message {
    text-align: center;
    padding: 50px 0;
    color: var(--gray-500);
}

.end-message i {
    font-size: 52px;
    color: var(--orange);
    margin-bottom: 15px;
    display: inline-block;
}

#search-load-more-container {
    text-align: center;
    margin-top: 40px;
}

/* ---------- EMPTY STATES ---------- */
.empty-state {
    text-align: center;
    padding: 70px 24px;
    color: var(--gray-400);
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 18px;
    display: inline-block;
    color: var(--orange);
}

/* ============================================
   NOTIFICATION SYSTEM - FULLY FIXED FOR MOBILE
   ============================================ */
.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.notification {
    background: var(--black);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-left: 4px solid var(--orange);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    animation: slideInRight 0.3s ease;
    pointer-events: auto;
    position: relative;
}

.notification-success {
    background: var(--black);
    border-left-color: #10b981;
}

.notification-error {
    background: var(--black);
    border-left-color: #dc2626;
}

.notification-warning {
    background: var(--black);
    border-left-color: #f59e0b;
}

.notification-info {
    background: var(--black);
    border-left-color: var(--orange);
}

.notification-content {
    flex: 1;
    font-size: 14px;
}

.notification-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 18px;
    padding: 0 6px;
    transition: color 0.2s;
}

.notification-close:hover {
    color: var(--orange);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN - FIXED FOR SMALL DEVICES (<750px)
   ============================================ */

/* Medium Devices (992px and below) */
@media (max-width: 992px) {
    section {
        padding: 50px 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 20px;
    }
    
    .slide img {
        height: 480px;
    }
    
    .slide-content h2 {
        font-size: 32px;
    }
}

/* Tablet & Small Devices (768px and below) */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 20px;
        overflow-x: hidden;
    }
    
    section {
        padding: 40px 0;
        overflow-x: hidden;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-title::after {
        bottom: -14px;
        width: 50px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .product-body {
        padding: 14px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .product-meta {
        font-size: 11px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    /* PRODUCT ACTIONS - ALWAYS VISIBLE ON MOBILE */
    .product-actions {
        opacity: 1 !important;
        flex-direction: row;
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    
    .action-btn {
        width: 34px;
        height: 34px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(4px);
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    
    .action-btn:active {
        transform: scale(0.95);
        background: var(--orange);
        color: white;
    }
    
    /* Slider adjustments for mobile */
    .slide img {
        height: 380px;
    }
    
    .slide-content {
        position: relative;
        bottom: auto;
        left: auto;
        margin: -50px 20px 20px;
        padding: 24px;
        max-width: none;
        background: var(--white);
        border-left: 4px solid var(--orange);
    }
    
    .slide-content h2 {
        font-size: 24px;
        color: var(--black);
    }
    
    .slide-content p {
        font-size: 14px;
        color: var(--gray-600);
    }
    
    .slide-tag {
        background: var(--orange);
        color: var(--white);
    }
    
    .slide-buttons {
        gap: 10px;
    }
    
    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .slider-controls {
        padding: 0 16px;
    }
    
    .slide-counter {
        display: none;
    }
    
    .slider-dots {
        bottom: 16px;
    }
    
    /* NOTIFICATION FIX FOR MOBILE - FULL VISIBLE */
    .notification-container {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: auto;
        max-width: none;
        width: auto;
        z-index: 10000;
        gap: 10px;
    }
    
    .notification {
        padding: 14px 16px;
        border-left-width: 4px;
        animation: slideInDown 0.3s ease;
    }
    
    @keyframes slideInDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .notification-content {
        font-size: 13px;
        padding-right: 24px;
    }
    
    .notification-close {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 16px;
        padding: 8px;
    }
}

/* Small Devices (576px and below) */
@media (max-width: 576px) {
    section {
        padding: 32px 0;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-actions {
        top: 6px;
        right: 6px;
        gap: 5px;
    }
    
    .action-btn {
        width: 30px;
        height: 30px;
    }
    
    .action-btn i {
        font-size: 12px;
    }
    
    .product-body {
        padding: 10px;
    }
    
    .product-title {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .product-price {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .btn-block {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .badge {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .slide img {
        height: 300px;
    }
    
    .slide-content {
        margin: -40px 16px 16px;
        padding: 18px;
    }
    
    .slide-content h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .slide-content p {
        font-size: 12px;
        margin-bottom: 16px;
    }
    
    .slide-tag {
        font-size: 10px;
        padding: 4px 10px;
        margin-bottom: 12px;
    }
    
    .slide-buttons .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .view-all-link {
        font-size: 12px;
    }
    
    .category-body h3 {
        font-size: 14px;
    }
    
    .category-body .btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    /* Notification on very small screens */
    .notification-container {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    
    .notification {
        padding: 10px 12px;
    }
    
    .notification-content {
        font-size: 12px;
    }
}

/* Specific fix for 750px breakpoint */
@media (max-width: 750px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Prevent any element from causing horizontal scroll */
    .products-grid,
    .category-grid,
    .hero-slider,
    .search-results-section,
    [class*="grid"],
    [class*="container"] {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure all images are responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix any potential overflow from flex/grid children */
    .product-card,
    .category-card {
        min-width: 0;
        width: 100%;
    }
    
    /* Improve touch targets */
    .action-btn,
    .slider-arrow,
    .notification-close,
    .view-all-link,
    .btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Prevent text overflow */
    .product-title a,
    .category-body h3 a,
    .view-all-link {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* Landscape mode fix for mobile */
@media (max-width: 750px) and (orientation: landscape) {
    .slide img {
        height: 250px;
    }
    
    .notification-container {
        top: 4px;
        left: 4px;
        right: 4px;
    }
    
    .notification {
        padding: 8px 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* Touch device optimizations (no hover, always visible) */
@media (hover: none) and (pointer: coarse) {
    .product-actions {
        opacity: 1 !important;
    }
    
    .action-btn,
    .btn,
    .view-all-link,
    .slider-arrow,
    .notification-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .action-btn:active {
        transform: scale(0.95);
        background: var(--orange);
        color: white;
    }
}

/* ---------- ADDITIONAL UTILITIES ---------- */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 28px;
}

.mb-4 {
    margin-bottom: 28px;
}

/* Input fields - orange focus */
input,
select,
textarea {
    border: 1px solid var(--gray-300);
    padding: 12px 14px;
    font-size: 14px;
    background: var(--white);
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--orange);
}

/* Links */
a {
    color: var(--black);
    text-decoration: none;
}

a:hover {
    color: var(--orange);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--orange);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--orange-dark);
}

/* Selection color */
::selection {
    background: var(--orange);
    color: var(--white);
}