/* ============================================
   Afrah Plastics — Unified Stylesheet
   ============================================ */

:root {
    --primary: #0066cc;
    --primary-dark: #004d99;
    --secondary-dark: #0055aa;
    --accent: #ff6b00;
    --accent-dark: #e05d00;
    --light: #f8f9fa;
    --light-gray: #f5f5f5;
    --dark: #212529;
    --dark-gray: #333;
    --gray: #6c757d;
    --white: #ffffff;
    --success-color: #2e7d32;
    --success-bg: #e6f7e6;
    --error-color: #c62828;
    --error-bg: #ffebee;
    --warning-bg: #fff3cd;
    --warning-border: #ffeaa7;
    --warning-text: #856404;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f9f9f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
}

/* ============================================
   Header & Navigation
   ============================================ */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

.logo-container h1 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
}

nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--dark-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

nav a:hover,
nav a.active {
    color: var(--primary);
}

nav a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

nav a:hover:after,
nav a.active:after {
    width: 100%;
}

/* ============================================
   Layout helpers
   ============================================ */
main {
    flex: 1;
}

.page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 0.3rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-whatsapp {
    background-color: #25d366;
}

.btn-whatsapp:hover {
    background-color: #1da851;
}

/* ============================================
   Hero (homepage)
   ============================================ */
.hero {
    background: linear-gradient(rgba(0, 51, 102, 0.75), rgba(0, 51, 102, 0.75)),
                url('../Images/IMG_20250407_180313.jpg') center/cover no-repeat;
    color: var(--white);
    padding: 6rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* ============================================
   Sections / Cards
   ============================================ */
.section {
    padding: 4rem 2rem;
}

.section-light {
    background-color: var(--light);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--gray);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.testimonial-card {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

.testimonial-text p {
    font-style: italic;
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-info h4 {
    margin: 0;
    color: var(--dark);
}

.author-info p {
    margin: 0;
    color: var(--gray);
    font-size: 0.9rem;
}

.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    text-align: center;
    padding: 4rem 2rem;
}

.cta-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ============================================
   Product grid (homepage preview & products page)
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.products-grid .product-card {
    background: var(--white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.products-grid .product-card:hover {
    transform: translateY(-10px);
}

.products-grid .product-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.products-grid .product-info {
    padding: 1.2rem;
}

.products-grid .product-info h3 {
    margin-bottom: 0.5rem;
}

.products-grid .product-info p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.product-price {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

/* ============================================
   Products page — category filter + grid
   ============================================ */
.category-nav {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.category-nav h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    color: var(--primary);
}

.category-scroll {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    justify-content: center;
    flex-wrap: wrap;
}

.category-scroll button {
    flex-shrink: 0;
    padding: 0.5rem 1.2rem;
    background: #f0f0f0;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    color: var(--dark);
}

.category-scroll button:hover {
    background: #e0e0e0;
}

.category-scroll button.active {
    background: var(--primary);
    color: var(--white);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    background: var(--white);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card img.main-product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    transition: opacity 0.3s ease;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.product-info {
    padding: 1rem;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.variant-selector {
    margin: 10px 0;
}

.variant-dropdown {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    font-family: inherit;
}

.price-stock-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.price {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2em;
}

.stock {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    display: inline-block;
}

.in-stock {
    background: var(--success-bg);
    color: var(--success-color);
}

.out-of-stock {
    background: var(--error-bg);
    color: var(--error-color);
}

.order-btn {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.order-btn:hover {
    background-color: var(--secondary-dark);
}

.order-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* ============================================
   Forms (contact / order)
   ============================================ */
.form-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.form-card h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background-color: var(--secondary-dark);
}

.submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* ============================================
   Contact page specific
   ============================================ */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.info-item {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.info-icon {
    background-color: var(--light-gray);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.info-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.info-text p,
.info-text a {
    margin: 0;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.info-text a:hover {
    color: var(--primary);
}

.business-hours {
    margin-top: 30px;
}

.business-hours h3 {
    margin-bottom: 15px;
    color: var(--dark-gray);
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
}

.hours-table tr {
    border-bottom: 1px solid #eee;
}

.hours-table tr:last-child {
    border-bottom: none;
}

.hours-table td {
    padding: 10px 0;
}

.hours-table td:last-child {
    text-align: right;
    font-weight: 500;
}

.map-container {
    margin-top: 40px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 400px;
    border: none;
}

/* ============================================
   Order page
   ============================================ */
.order-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.product-selection,
.cart-summary {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.cart-summary {
    position: sticky;
    top: 90px;
    align-self: start;
}

.cart-items {
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.cart-item:hover {
    background-color: #f9f9f9;
}

.cart-total {
    font-weight: bold;
    font-size: 1.2em;
    margin: 15px 0;
    text-align: right;
}

.empty-cart {
    text-align: center;
    color: #666;
    padding: 20px;
}

.minimum-order-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
}

.minimum-order-met {
    background: var(--success-bg);
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
}

.remove-btn {
    background: none;
    border: none;
    color: #cc0000;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 5px;
    margin-left: 10px;
}

.remove-btn:hover {
    color: #ff0000;
}

/* ============================================
   Feedback notification (toast)
   ============================================ */
.feedback-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 90vw;
}

.feedback-notification.error {
    background: #cc0000;
}

.feedback-notification.warning {
    background: #ff9900;
}

.feedback-notification.success {
    background: var(--success-color);
}

/* ============================================
   Footer
   ============================================ */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 1rem 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo {
    height: 40px;
    width: auto;
}

.footer-about h3 {
    font-size: 1.4rem;
    margin: 0;
    color: #fff;
}

.footer-description {
    color: #bdc3c7;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-title {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent);
}

.footer-menu {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 0.75rem;
}

.footer-menu a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-menu a:hover {
    color: #fff;
}

.contact-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.contact-item i {
    color: var(--accent);
    margin-top: 0.2rem;
}

.contact-item a,
.contact-item span {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: #fff;
}

.location-link {
    color: #bdc3c7;
    transition: color 0.3s;
}

.location-link:hover {
    color: #fff;
}

.branch-label {
    font-weight: bold;
    color: var(--accent);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* ============================================
   Floating WhatsApp button
   ============================================ */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background-color: #25d366;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 900;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

/* ============================================
   Chatbot widget
   ============================================ */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.08);
}

.chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 350px;
    max-width: 92vw;
    height: 480px;
    max-height: 70vh;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 950;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s ease;
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chatbot-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chatbot-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f5f7fa;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.chat-msg.bot {
    background: #fff;
    color: var(--dark);
    align-self: flex-start;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg.typing {
    color: #999;
    font-style: italic;
}

.chatbot-input {
    display: flex;
    border-top: 1px solid #eee;
    padding: 10px;
    gap: 8px;
    background: #fff;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: inherit;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.chatbot-input button {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}

.chatbot-input button:hover {
    background: var(--secondary-dark);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 1rem;
        text-align: center;
    }

    nav {
        justify-content: center;
    }

    .contact-content,
    .order-form-grid {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .chatbot-window {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 84px;
    }

    .chatbot-toggle,
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .logo-container h1 {
        font-size: 1.5rem;
    }

    nav a {
        font-size: 0.95rem;
    }
}
