/* General Body Styles */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
}

/* Header Styles */
header {
    background-color: #ffffff;
    color: #333;
    padding: 0.7rem 0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
header .logo {
    font-weight: 700;
    font-size: 1.6rem;
    color: #333;
}
header nav ul .nav-link {
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    color: #555;
    font-weight: 500;
}
header nav ul .nav-link:hover {
    color: #dc3545 !important;
    background-color: transparent;
}

/* Hero Slider Section */
.hero-slider {
    margin-bottom: 30px;
}

.carousel-item img {
    width: 100%;
    height: 380px;
    object-fit: cover;
}
.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    max-width: 80%;
    left: 10%;
    right: 10%;
}
.carousel-caption h5 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
}
.carousel-caption p {
    font-size: 1.1rem;
    color: #eee;
}
.carousel-control-prev, .carousel-control-next {
    width: 5%;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Product Section Styles */
.product-section {
    padding: 25px 0;
    background-color: #f0f2f5;
}
.product-section h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}
.product-section p {
    font-size: 0.95rem;
    color: #777;
    margin-bottom: 25px;
}

/* Product Grid Styles (sera-bazar style) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 0 15px;
}

/* Product Card Styles (sera-bazar style) */
.product-card {
    background: #ffffff;
    border: 2px solid #e8e8e8; /* Changed to 2px */
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* Product Card Hover Effect (sera-bazar style) */
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    border-color: #dc3545;
}

.product-card img {
    width: 100%;
    height: 180px; /* Made taller */
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.product-card h3 {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 6px;
    padding: 0 8px;
    height: 38px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: normal;
    line-height: 1.3;
}

/* Price Info Section Styles (sera-bazar style) */
.price-info {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 10px;
    padding: 0 8px;
}

.price-info .current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc3545;
    margin: 0;
}

.price-info .old-price {
    font-size: 0.8rem;
    color: #888;
    text-decoration: line-through;
    margin: 0;
}

/* Discount Tag Styles (sera-bazar style) */
.discount-tag {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #dc3545;
    color: #fff;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
}

/* Order Button Styles (sera-bazar style) */
.product-card .btn-order {
    display: block;
    background-color: #dc3545;
    color: #fff;
    padding: 9px 12px;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    margin-top: auto;
    width: 100%;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.2), 0 2px 2px rgba(0,0,0,0.2);
}

.product-card .btn-order:hover {
    background-color: #c82333;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 1px rgba(0,0,0,0.2);
}

/* No Products Message */
p.message {
    text-align: center;
    font-size: 1.5rem;
    color: #777;
    padding: 50px 0;
}

/* Utility Classes for center alignment in Bootstrap */
.text-center {
    text-align: center;
}

/* --- Product Details (Landing Page) Specific Styles --- */
.product-page-wrapper {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.main-product-image img {
    width: 100%;
    height: 400px; /* Adjust as needed */
    object-fit: contain; /* Main image might need 'contain' for full product view */
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    background-color: #f9f9f9;
}

.additional-images {
    margin-top: 15px;
}
.additional-images .mini-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.additional-images .mini-thumb:hover {
    border-color: #dc3545;
    transform: scale(1.05);
}

.product-info-landing {
    padding-left: 20px;
}
.product-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}
.price-section-landing {
    margin-bottom: 20px;
}
.current-price-landing {
    font-size: 2.5rem;
    font-weight: 700;
    color: #dc3545;
}
.old-price-landing {
    font-size: 1.5rem;
    color: #888;
    text-decoration: line-through;
    margin-left: 10px;
}
.product-description-short {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}
.read-more-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}
.read-more-link:hover {
    text-decoration: underline;
}

/* Fixed Buy Now Section (Desktop) */
.fixed-buy-now {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.total-price-display {
    font-size: 1.5rem;
    font-weight: 600;
    color: #dc3545;
    text-align: center;
    margin-bottom: 20px;
}
.total-price-display span {
    font-size: 1.8rem;
    font-weight: 700;
}

.order-form-mini .form-label {
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}
.order-form-mini .form-control,
.order-form-mini .form-select {
    border-radius: 5px;
    border: 1px solid #ccc;
    padding: 10px 15px;
    font-size: 1rem;
}
.btn-buy-now {
    background-color: #dc3545;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    padding: 15px 20px;
    border-radius: 5px;
    border: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(220,53,69,0.3);
}
.btn-buy-now:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(220,53,69,0.4);
}
.btn-buy-now i {
    margin-right: 8px;
}

/* Full Product Description Section */
.product-full-description {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.product-full-description h2 {
    color: #333;
    font-weight: 600;
    font-size: 1.8rem;
}
.product-full-description .card-body {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.8;
}

/* Product Video Section */
.product-video-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.product-video-section h2 {
    color: #333;
    font-weight: 600;
    font-size: 1.8rem;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Mobile Fixed Buy Now Button */
.mobile-buy-now-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}
.mobile-buy-now-fixed .price-and-btn {
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 10px 15px;
}
.mobile-buy-now-fixed .btn {
    font-size: 1.1rem;
    padding: 10px 20px;
}

/* Modal for mobile order form */
#orderModal .modal-content {
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
#orderModal .modal-header {
    background-color: #dc3545;
    color: #fff;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
#orderModal .modal-title {
    font-weight: 700;
}
#orderModal .btn-close {
    filter: invert(1);
}
#orderModal .modal-body {
    padding: 25px;
}
#orderModal .form-label {
    font-weight: 600;
    color: #444;
}
#orderModal .form-control,
#orderModal .form-select {
    border-radius: 5px;
}
#orderModal .btn-lg {
    font-size: 1.2rem;
    padding: 12px 20px;
}

/* --- Admin Dashboard Specific Styles --- */
.admin-dashboard {
    padding: 20px 0;
}
.admin-dashboard h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}
.admin-dashboard h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #444;
    margin-top: 30px;
}
.product-form-section {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.product-form-section h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 25px;
}
.product-form-section .form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}
.product-form-section .form-control,
.product-form-section .form-select {
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 10px 15px;
}
.product-form-section .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.product-form-section .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Table styles */
.table-responsive {
    margin-top: 20px;
}
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners */
}
.table th, .table td {
    padding: 12px 15px;
    vertical-align: middle;
    border: 1px solid #e9ecef;
}
.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #e9ecef;
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}
.table tbody tr:hover {
    background-color: #f2f2f2;
}
.table .btn {
    padding: 5px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
}
.table .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #343a40;
}
.table .btn-warning:hover {
    background-color: #e0a800;
    border-color: #e0a800;
}
.table .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}
.table .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Messages (Success/Error) */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
}
.message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}


/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 10px;
    }
    .product-card img {
        height: 140px;
    }
    .product-card h3 {
        font-size: 0.85rem;
        height: 36px;
    }
    .price-info .current-price {
        font-size: 1rem;
    }
    .price-info .old-price {
        font-size: 0.75rem;
    }
    .discount-tag {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    .btn-order {
        font-size: 0.9rem;
        padding: 8px 10px;
    }
    .carousel-item img {
        height: 300px;
    }
    .carousel-caption h5 {
        font-size: 1.8rem;
    }
    .carousel-caption p {
        font-size: 0.9rem;
    }

    /* Product Landing Page Adjustments */
    .product-info-landing {
        padding-left: 0;
        margin-top: 20px;
    }
    .product-title {
        font-size: 2rem;
    }
    .current-price-landing {
        font-size: 2rem;
    }
    .old-price-landing {
        font-size: 1.2rem;
    }
    .product-description-short {
        font-size: 1rem;
    }
    .fixed-buy-now {
        position: static; /* Remove fixed position on tablet/mobile */
        margin-top: 30px;
    }
    .product-video-section .video-container {
        padding-bottom: 65%; /* Adjust for smaller screens */
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        padding: 0 10px;
    }
    .product-card img {
        height: 120px;
    }
    .product-card h3 {
        height: 34px;
        font-size: 0.8rem;
    }
    .price-info .current-price {
        font-size: 0.95rem;
    }
    .price-info .old-price {
        font-size: 0.7rem;
    }
    .btn-order {
        padding: 7px 8px;
        font-size: 0.85rem;
    }
    .carousel-item img {
        height: 250px;
    }
    .carousel-caption h5 {
        font-size: 1.5rem;
    }
    .carousel-caption p {
        font-size: 0.8rem;
    }

    /* Product Landing Page Adjustments */
    .main-product-image img {
        height: 250px;
    }
    .product-title {
        font-size: 1.8rem;
    }
    .current-price-landing {
        font-size: 1.8rem;
    }
    .old-price-landing {
        font-size: 1rem;
    }
    .product-description-short {
        font-size: 1rem;
    }
    .fixed-buy-now {
        display: none; /* Hide desktop fixed buy now on smaller screens */
    }
    .product-full-description h2,
    .product-video-section h2 {
        font-size: 1.6rem;
    }
    .product-full-description .card-body {
        font-size: 1rem;
    }
    .product-video-section .video-container {
        padding-bottom: 75%; /* Adjust for smaller screens */
    }

    /* Admin Table Adjustments */
    .table-responsive table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table thead, .table tbody, .table th, .table td, .table tr {
        display: block;
    }
    .table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    .table tr {
        border: 1px solid #dee2e6;
        margin-bottom: 0.625em;
    }
    .table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    .table td:before {
        position: absolute;
        top: 0;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: #495057;
    }
    /* Updated :before content for each td */
    .table td:nth-of-type(1):before { content: "ID"; }
    .table td:nth-of-type(2):before { content: "ছবি"; }
    .table td:nth-of-type(3):before { content: "নাম"; }
    .table td:nth-of-type(4):before { content: "বর্তমান মূল্য"; }
    .table td:nth-of-type(5):before { content: "পূর্বের মূল্য"; }
    .table td:nth-of-type(6):before { content: "ঢাকার ভিতরে শিপিং"; }
    .table td:nth-of-type(7):before { content: "ঢাকার বাইরে শিপিং"; }
    .table td:nth-of-type(8):before { content: "ক্রিয়াকলাপ"; }
    .table td a {
        display: block;
        margin-bottom: 5px;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
    .carousel-item img {
        height: 200px;
    }
    .carousel-caption {
        display: none !important;
    }
    .product-section h1 {
        font-size: 1.6rem;
    }
    .product-section p {
        font-size: 0.85rem;
    }
    .product-card img {
        height: 180px;
    }
    .product-card h3 {
        height: auto;
        -webkit-line-clamp: unset;
        font-size: 1rem;
    }
    .price-info .current-price {
        font-size: 1.1rem;
    }
    .price-info .old-price {
        font-size: 0.85rem;
    }
    .btn-order {
        padding: 10px 15px;
        font-size: 1rem;
    }

    /* Product Landing Page Adjustments */
    .main-product-image img {
        height: 200px;
        padding: 5px;
    }
    .additional-images .mini-thumb {
        width: 50px;
        height: 50px;
    }
    .product-title {
        font-size: 1.6rem;
        text-align: center;
    }
    .price-section-landing {
        justify-content: center;
    }
    .current-price-landing {
        font-size: 1.8rem;
    }
    .old-price-landing {
        font-size: 1rem;
    }
    .product-description-short {
        font-size: 0.9rem;
        text-align: center;
    }
    .read-more-link {
        display: block;
        text-align: center;
        margin-top: 10px;
    }
    .mobile-buy-now-fixed {
        display: block !important; /* Show mobile fixed button */
    }
    .product-page-wrapper {
        padding: 10px;
    }
    .product-full-description,
    .product-video-section {
        padding: 15px;
    }
    .product-full-description h2,
    .product-video-section h2 {
        font-size: 1.4rem;
    }
    .product-full-description .card-body {
        font-size: 0.95rem;
    }
    .product-video-section .video-container {
        padding-bottom: 80%; /* Even higher for small screens */
    }

    /* Admin Form Adjustments */
    .admin-dashboard h1, .admin-dashboard h2, .product-form-section h3 {
        font-size: 1.5rem;
    }
    .product-form-section .row > div {
        margin-bottom: 10px;
    }
    .product-form-section .btn-primary {
        padding: 10px 15px;
        font-size: 1rem;
    }
}