/* ============================================
   Khan Karyana Store - Custom Styles
   ============================================ */

:root {
    --brand-green: #1e6b3c;
    --brand-green-dark: #144d2b;
    --brand-gold: #d4a017;
    --bg-light: #f7f7f2;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

.main-navbar {
    background: linear-gradient(90deg, var(--brand-green), var(--brand-green-dark));
}
.main-navbar .navbar-brand {
    font-size: 1.4rem;
}
.cart-badge {
    font-size: 0.65rem;
    position: relative;
    top: -8px;
    right: 2px;
}

.hero-section {
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
    border-radius: 0 0 30px 30px;
    margin-bottom: 30px;
}
.hero-section h1 {
    font-weight: 800;
}
.hero-section p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.category-pill {
    display: inline-block;
    padding: 6px 18px;
    margin: 4px;
    border-radius: 30px;
    background: #fff;
    border: 1px solid var(--brand-green);
    color: var(--brand-green);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.category-pill:hover, .category-pill.active {
    background: var(--brand-green);
    color: #fff;
}

.product-card {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    background: #fff;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.product-card img {
    height: 160px;
    object-fit: cover;
    background: #eee;
}
.product-card .card-body {
    display: flex;
    flex-direction: column;
}
.product-price {
    font-weight: 700;
    color: var(--brand-green);
    font-size: 1.15rem;
}
.stock-badge {
    font-size: 0.75rem;
}

.btn-brand {
    background-color: var(--brand-green);
    border-color: var(--brand-green);
    color: #fff;
}
.btn-brand:hover {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
    color: #fff;
}

.main-footer {
    background: var(--brand-green-dark);
}

.cart-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
}

.admin-sidebar {
    background: var(--brand-green-dark);
    min-height: 100vh;
    color: #fff;
}
.admin-sidebar a {
    color: #e6e6e6;
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    margin: 4px 10px;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: var(--brand-green);
    color: #fff;
}
.stat-card {
    border-radius: 14px;
    color: #fff;
    padding: 20px;
}

/* ============ v2 additions ============ */

/* Banner Slider */
.banner-img {
    height: 320px;
    object-fit: cover;
}
@media (max-width: 768px) {
    .banner-img { height: 180px; }
}
.carousel-caption h3 {
    font-weight: 800;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
}
.carousel-caption {
    background: rgba(0,0,0,0.35);
    border-radius: 10px;
}

/* Category Sidebar */
.category-sidebar-list a {
    border: none;
    border-radius: 8px !important;
    margin-bottom: 4px;
    color: #333;
    font-size: 0.95rem;
}
.category-sidebar-list a:hover {
    background: #eef6f0;
}
.category-sidebar-list a.active-cat {
    background: var(--brand-green);
    color: #fff;
    font-weight: 600;
}

/* Featured products horizontal scroll on mobile */
.overflow-auto::-webkit-scrollbar {
    height: 6px;
}
.overflow-auto::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Payment method cards */
.payment-option {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.payment-option.selected {
    border-color: var(--brand-green);
    background: #eef6f0;
}
.payment-option.disabled-option {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Thermal Receipt Print Styles */
.receipt-box {
    width: 280px;
    margin: 0 auto 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px dashed #999;
}
.receipt-box hr {
    border-top: 1px dashed #333;
}
.receipt-copy-label {
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Receipt info (order#, customer, phone, address wagera) */
.receipt-info-table {
    width: 100%;
    font-size: 12px;
}
.receipt-info-table td {
    padding: 1px 0;
    vertical-align: top;
}
.receipt-info-table .rlabel {
    width: 65px;
    font-weight: bold;
    white-space: nowrap;
}
.receipt-info-table .rvalue {
    width: auto;
}

/* Receipt items (dayen amount, bayen tafseel) */
.receipt-items-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}
.receipt-items-table tr {
    border-bottom: 1px dashed #ccc;
}
.receipt-items-table td {
    padding: 4px 2px;
    vertical-align: top;
}
.receipt-items-table .item-amount {
    width: 80px;
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
}
.receipt-items-table .item-desc {
    width: auto;
    text-align: right;
}
.receipt-items-table .item-sub {
    font-size: 10px;
    color: #555;
}
.receipt-items-table .total-row {
    border-bottom: none;
    font-size: 14px;
}
.receipt-items-table .total-row .item-amount,
.receipt-items-table .total-row .item-desc {
    font-weight: bold;
}
@media print {
    body { background: #fff; }
    .no-print { display: none !important; }
    .receipt-box { border: none; page-break-after: always; }
}

/* Navbar search bar (har page par) */
.navbar-search-form {
    max-width: 350px;
    width: 100%;
}
.navbar-search-form .form-control {
    border-radius: 20px 0 0 20px;
}
.navbar-search-form .btn {
    border-radius: 0 20px 20px 0;
}


/* ============ Flash News Ticker (Urdu: RTL text, moves left to right) ============ */
.news-ticker {
    display: flex;
    align-items: stretch;
    direction: rtl;
    background: var(--brand-gold);
    color: #2b2100;
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
}
.news-ticker-label {
    flex: 0 0 auto;
    background: #b3191e;
    color: #fff;
    padding: 8px 16px;
    white-space: nowrap;
    z-index: 2;
}
.news-ticker-viewport {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
    direction: rtl;
    container-type: inline-size;   /* group ki chorai = viewport ki chorai */
}
.news-ticker-track {
    display: flex;
    width: max-content;
    padding: 8px 0;
    animation-name: ticker-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-duration: 40s;
}
.news-ticker:hover .news-ticker-track {
    animation-play-state: paused;
}
/* Har group kam az kam viewport jitna chora hota hai, is liye
   chota message bhi ek waqt mein sirf ek hi dafa nazar aata hai */
.news-ticker-group {
    display: flex;
    flex: 0 0 auto;
    min-width: 100vw;      /* purane browsers ke liye */
    min-width: 100cqw;     /* naye browsers: bilkul viewport ke barabar */
    white-space: nowrap;
}
.news-ticker-item {
    display: inline-block;
    padding: 0 40px;
    direction: rtl;
}
.news-ticker-item.ticker-price { color: #7a0000; }
.news-ticker-item.ticker-alert { color: #b3191e; text-decoration: underline; }

/* Left se right ki taraf (RTL mein track right se shuru hota hai) */
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(50%); }
}
@media (max-width: 576px) {
    .news-ticker { font-size: 0.9rem; }
    .news-ticker-label { padding: 6px 10px; }
}
