/**
 * Pirgacha Shop - Main Stylesheet
 * Modern, Mobile-First Black & White Theme
 */

/* CSS Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #000000;
    --secondary: #333333;
    --accent: #555555;
    --light: #f8f9fa;
    --white: #ffffff;
    --border: #e0e0e0;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--primary);
    background-color: var(--light);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: var(--primary);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo span {
    color: var(--border);
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: var(--white);
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-count {
    background: var(--white);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 60px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 25px;
}

.hero .btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--white);
    color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius);
    transition: var(--transition);
}

.hero .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Section */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 10px auto 0;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.product-card .image {
    position: relative;
    padding-top: 100%;
    background: var(--light);
    overflow: hidden;
    display: block;
}

.product-card .image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    display: block;
}

.product-card .image .no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    color: var(--accent);
    font-size: 0.9rem;
}

.product-card:hover .image img {
    transform: scale(1.05);
}

.product-card .info {
    padding: 15px;
}

.product-card .name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.product-card .regular-price {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-card .btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.product-card .btn:hover {
    background: var(--secondary);
}

/* Product Card Button Group */
.product-card .btn-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.product-card .btn-group .btn {
    margin-top: 0;
    flex: 1;
    padding: 8px 5px;
    font-size: 0.8rem;
}

.product-card .btn-group .btn-cart {
    background: var(--primary);
}

.product-card .btn-group .btn-direct {
    background: var(--success);
}

.product-card .btn-group .btn-direct:hover {
    background: #218838;
}

/* Single Product Page */
.product-single {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-main-image {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: var(--light);
}

.product-main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

.product-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-thumbnails img.active,
.product-thumbnails img:hover {
    border-color: var(--primary);
}

.product-details {
    padding: 20px;
}

.product-details h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.product-details .price-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.product-details .current-price {
    font-size: 1.8rem;
    font-weight: bold;
}

.product-details .old-price {
    font-size: 1.2rem;
    color: var(--accent);
    text-decoration: line-through;
}

.product-details .description {
    color: var(--secondary);
    margin-bottom: 25px;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    background: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
}

.quantity-selector button:hover {
    border-color: var(--primary);
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.delivery-info {
    background: var(--light);
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.delivery-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

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

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

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Cart Page */
.cart-page {
    padding: 20px 0;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
}

.cart-empty h2 {
    margin-bottom: 15px;
}

.cart-empty p {
    color: var(--accent);
    margin-bottom: 20px;
}

.cart-items {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item .image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.cart-item .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.cart-item .details {
    flex: 1;
}

.cart-item .name {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item .price {
    color: var(--primary);
    font-weight: bold;
}

.cart-item .quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.cart-item .quantity button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: var(--light);
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
}

.cart-item .quantity span {
    min-width: 30px;
    text-align: center;
}

.cart-item .remove {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 10px;
    cursor: pointer;
}

.cart-summary {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.cart-summary .row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cart-summary .row:last-of-type {
    border-bottom: none;
}

.cart-summary .total {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Checkout Page */
.checkout-page {
    padding: 20px 0;
}

.checkout-form {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

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

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

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.payment-option:hover,
.payment-option.selected {
    border-color: var(--primary);
    background: var(--light);
}

.payment-option input {
    width: auto;
}

.payment-info {
    background: var(--light);
    padding: 15px;
    border-radius: var(--radius);
    margin-top: 15px;
    border-left: 4px solid var(--primary);
}

.order-summary-box {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

/* Order Confirmation */
.confirmation-page {
    text-align: center;
    padding: 40px 20px;
}

.confirmation-box {
    background: var(--white);
    padding: 40px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.confirmation-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--white);
    font-size: 2.5rem;
}

.order-id {
    background: var(--light);
    padding: 15px;
    border-radius: var(--radius);
    margin: 20px 0;
    font-size: 1.2rem;
}

/* Orders Page */
.orders-page {
    padding: 20px 0;
}

.order-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.order-card .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.order-card .order-number {
    font-weight: bold;
}

.order-card .date {
    color: var(--accent);
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-confirmed {
    background: #cce5ff;
    color: #004085;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

/* Categories */
.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
}

.category-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 25px;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Footer */
.footer {
    background: var(--primary);
    color: var(--white);
    padding: 40px 0 20px;
    margin-top: 40px;
}

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

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
}

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

.footer-section .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    transition: var(--transition);
}

.footer-section .contact-link:hover {
    opacity: 0.8;
}

.footer-section .whatsapp-link {
    background: rgba(37, 211, 102, 0.1);
    padding: 8px 12px;
    border-radius: 5px;
    margin-top: 5px;
}

.footer-section .whatsapp-link:hover {
    background: rgba(37, 211, 102, 0.2);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Admin Styles */
.admin-header {
    background: var(--primary);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 15px;
    border-radius: var(--radius);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.admin-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.admin-card h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .label {
    color: var(--accent);
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--light);
    font-weight: 600;
}

.admin-table tr:hover {
    background: var(--light);
}

.admin-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-edit {
    background: #17a2b8;
    color: white;
}

.btn-delete {
    background: var(--danger);
    color: white;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--light);
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
}

/* Responsive Styles */
@media (min-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .product-single {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .product-gallery {
        padding: 20px;
    }
    
    .checkout-grid {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 767px) {
    .header .container {
        flex-direction: column;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Image Placeholder */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    color: var(--accent);
    font-size: 0.9rem;
}
