/* ============================================
   Pimbukaletyreg - Main Stylesheet
   Modern, responsive, mobile-first design
   ============================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --max-width: 1200px;
    --spacing: 1rem;
    --spacing-lg: 2rem;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing);
    color: var(--primary-color);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--spacing);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header */
header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing) 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
    transition: opacity 0.3s ease;
}

.logo:hover img {
    opacity: 0.8;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

nav a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

nav a:hover {
    color: var(--accent-color);
}

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

nav a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0.5rem 0.75rem;
    z-index: 1001;
    position: relative;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
}

.menu-toggle:hover {
    background-color: var(--bg-light);
}

.menu-toggle:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 4rem var(--spacing);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: var(--spacing);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.95;
}

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

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Sections */
.section {
    padding: var(--spacing-lg) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.feature-card {
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.feature-card h3 {
    color: var(--accent-color);
    margin-bottom: var(--spacing);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.product-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

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

.product-info {
    padding: var(--spacing);
}

.product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--spacing);
    min-height: 3rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 0.875rem;
    margin-bottom: var(--spacing);
}

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

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

/* Categories */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing);
    margin-bottom: var(--spacing-lg);
}

.category-link {
    display: block;
    padding: var(--spacing-lg);
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-link:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
}

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

/* Cart Table */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-lg);
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.cart-table th,
.cart-table td {
    padding: var(--spacing);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cart-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--primary-color);
}

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

.quantity-input {
    width: 60px;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.cart-total {
    text-align: right;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: var(--spacing-lg);
    padding: var(--spacing);
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
}

/* Contact Info */
.contact-info {
    background-color: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.contact-info h3 {
    margin-bottom: var(--spacing);
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.contact-info strong {
    color: var(--primary-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    color: white;
    margin-bottom: var(--spacing);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}


/* Content Pages */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing);
}

.content-page h2 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing);
}

.content-page h3 {
    margin-top: var(--spacing);
    margin-bottom: 0.5rem;
}

.content-page ul,
.content-page ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing);
}

.content-page li {
    margin-bottom: 0.5rem;
}

.last-updated {
    color: var(--text-light);
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: var(--spacing-lg);
}

/* Responsive Design */

/* Tablet Styles (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 var(--spacing-lg);
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--spacing);
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing);
    }

    .categories {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        padding: 3rem var(--spacing-lg);
    }

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

    .hero p {
        font-size: 1.125rem;
    }

    .product-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .product-card:hover {
        transform: translateY(-3px);
    }

    .cart-table {
        font-size: 0.9375rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.75rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-page {
        padding: var(--spacing-lg) var(--spacing-lg);
    }

    /* Navigation for tablets - keep visible */
    nav {
        display: flex !important;
        position: static !important;
    }

    nav ul {
        gap: var(--spacing);
    }

    .menu-toggle {
        display: none;
    }

    /* Logo size for tablets */
    .logo img {
        height: 45px;
    }

    /* Form improvements for tablets */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 1rem;
    }

}

/* Mobile Styles (up to 768px) */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

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

    .hero p {
        font-size: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    /* Ensure header-content can contain absolute positioned nav */
    .header-content {
        position: relative;
    }

    nav {
        width: 100%;
        display: none !important;
        margin-top: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        padding: 0;
        border-top: 1px solid var(--border-color);
    }

    nav.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure nav is visible when active */
    nav.active ul {
        display: flex !important;
        flex-direction: column;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav li {
        border-bottom: 1px solid var(--border-color);
    }

    nav a {
        display: block;
        padding: var(--spacing);
        color: var(--text-color);
    }

    nav a:hover,
    nav a:active {
        background-color: var(--bg-light);
        color: var(--accent-color);
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing);
    }

    .cart-table {
        font-size: 0.875rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
    }

    .cart-table tr {
        margin-bottom: var(--spacing);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: var(--spacing);
        background-color: var(--bg-color);
    }

    .cart-table td {
        border: none;
        padding: 0.5rem 0;
        text-align: left;
    }

    .cart-table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        display: inline-block;
        min-width: 100px;
    }

    .cart-table .quantity-input {
        width: 100%;
        max-width: 100px;
    }


    /* Mobile-specific improvements */
    .container {
        padding: 0 var(--spacing);
    }

    .section {
        padding: var(--spacing) 0;
    }

    /* Google Maps for mobile */
    .map-container {
        height: 300px !important;
    }

    /* Forms on mobile */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Better touch targets */
    .btn {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
    }

    /* Categories on mobile */
    .categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    :root {
        --spacing: 0.75rem;
        --spacing-lg: 1.5rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

/* Additional Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Header improvements */
    .header-content {
        padding: var(--spacing) 0;
    }

    /* Product cards - better spacing */
    .product-info {
        padding: var(--spacing);
    }

    .product-name {
        font-size: 1.125rem;
    }

    .product-price {
        font-size: 1.375rem;
    }

    /* Cart table improvements */
    .cart-table {
        display: table;
        width: 100%;
    }

    .cart-table th:nth-child(1),
    .cart-table td:nth-child(1) {
        min-width: 150px;
    }

    /* Contact page improvements */
    .contact-info {
        padding: var(--spacing-lg);
    }

    /* Google Maps iframe for tablets */
    .map-container {
        height: 450px !important;
    }

    /* Form layout improvements */
    form {
        max-width: 600px;
    }

    /* Section spacing */
    .section {
        padding: var(--spacing-lg) 0;
    }

    /* Hero section adjustments */
    .hero {
        min-height: 300px;
        display: flex;
        align-items: center;
    }

    /* Category links - better touch targets */
    .category-link {
        padding: var(--spacing-lg);
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Landscape tablet orientation (768px - 1024px landscape) */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .hero {
        padding: 2rem var(--spacing-lg);
        min-height: 250px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Touch device optimizations for tablets */
@media (min-width: 769px) and (max-width: 1024px) and (hover: none) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.875rem 1.75rem;
    }

    nav a {
        padding: 0.75rem 1rem;
    }

    .product-card {
        cursor: pointer;
    }

    /* Remove hover effects on touch devices */
    .product-card:hover {
        transform: none;
    }

    .feature-card:hover {
        transform: none;
    }
}

/* Additional responsive improvements */
@media (min-width: 481px) and (max-width: 768px) {
    /* Small tablets / large phones */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories {
        grid-template-columns: repeat(3, 1fr);
    }

    .cart-table {
        display: table;
        font-size: 0.9375rem;
    }

    .cart-table thead {
        display: table-header-group;
    }

    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: table-cell;
    }

    .cart-table tr {
        margin-bottom: 0;
        border: none;
        padding: 0;
        background-color: transparent;
    }

    .cart-table td:before {
        display: none;
    }

    .cart-table td {
        border-bottom: 1px solid var(--border-color);
        padding: var(--spacing);
        text-align: left;
    }
}

